lundi 20 avril 2015

Setting checkbox checked on page load in the Metronic AngularJS theme

I am developing an AngularJS app using the Metronic Admin Dashboard template. This is the code for my checkbox:

<div class="checkbox">
    <label>
        <input type="checkbox" data-ng-model="checkbox.isEnabled"> Enabled?
    </label>
</div>

I've confirmed that the value of checkbox.isEnabled is in fact true. I've also tried using data-ng-checked="checkbox.isEnabled, this also did not work. If I call Metronic.updateUniform(); after the page has fully loaded (I attached it to the click event of an tag) the checkbox DOES correctly update.

I can't seem to find a place where I can make the call. updateUniform() ui-router's $stateChangeSuccess event is still too early. Is there something I'm missing or is it really not possible to pre-check one of Metronic's themed checkboxes based on data in AnguularJS?




1 commentaire:

  1. http://keenthemes.com/forums/topic/ng-model-and-checkbox/

    this solves the problem

    RépondreSupprimer