This topic contains 3 replies, has 3 voices, and was last updated by Sean Sean 2 years, 6 months ago.

AngularJS and defaults for Checkboxes and Radio Buttons

  • razrYr

    Member Reply #1080

    When using AngularJS, I cannot default a checkbox or radio button using ng-model.  Regardless of whether my model value is true or false, the checkbox or radio button will not display as checked.   Metronic.init() calls either handleUniform() or handleiCheck() and one on those is the source of the problem.  If I comment either method, then the correct box or button is checked.  I see on the web there is another person with this issue.   The URL for that description of this problem is here:  Is there any solution to this issue?


    Posts: 4527
    Support Staff Reply #1096


    Please note you are using jquery plugin and its not by default integrated with angular js models. In your case you have 2 options: 1) to use it in jquery way. 2) integrate the unformjs plugin with AngularJS following below tutorials: 



    Posts: 4
    Member Reply #8663

    In previous versions there was in your app.js a function handleUniform in which I added a code that allow me to have another external control not affected by Metronic (that control name started by ‘mycontrol_’ as you can see in the code below. But I just found out that in the new version that function is not there anymore.


    This was the way I changed your handleuniform:

    // Handles custom checkboxes & radios using jQuery Uniform plugin

    var handleUniform = function () {

    if (!$().uniform) {



    var test = $(“input[type=checkbox]:not(.toggle, .md-check, .md-radiobtn, .make-switch, .icheck), input[type=radio]:not(.toggle, .md-check, .md-radiobtn, .star, .make-switch, .icheck)”).not(‘[name^=”mycontrol_“]’);


    if (test.size() > 0) {

    test.each(function() {

    if ($(this).parents(“.checker”).size() === 0) {









    //main function to initiate the theme

    init: function () {



    and that handleuniform function was called here :

    //Core handlers

    handleInit(); // initialize core variables

    handleOnResize(); // set and handle responsive


    //UI Component handlers

    handleMaterialDesign(); // handle material design

    handleUniform(); // hanfle custom radio & checkboxes


    How can I get now the same effect?






    Posts: 4527
    Support Staff Reply #8671


    In recent versions we removed Uniform plugin and now Metronic uses pure css based custom checkbox and radio buttons. So you can remove handleUniform function from your code and refer to the new custom radios and checkboxes. For more info please check the markup of the new checkbox and radios here:

    If you need any further clarifications please let us know.



You must be logged in to reply to this topic.