It turns out that I have this switch generated dynamically with ng-repeat
:
<div ng-repeat="model in modelo_final">
<div style="float:left; padding-right:100px;">
<div class="can-toggle demo-rebrand-2">
<input id={{model.id}} type="checkbox" ng-model="idrecibo[model.id]" ng-change="changeItem(model.id)">
<label for={{model.id}}>
<div class="can-toggle__switch" data-checked="{{identificador2}}" data-unchecked="{{identificador}}"></div>
<div class="can-toggle__label-text"><p style="font-size:15px; width:100px;">{{model.nombre}}</p></div>
</label>
</div>
</div>
</div>
and within all the operation that it fulfills, I just need to configure so that when I open the page it shows activated those that are active !, that is, it does not always return to false when reloading the page.
To know that, model brings together id and name an active which is 0 is deactivated, 1 activated.
then I thought about creating a ng-if
and asking if it is 1 that activates the switches but I can not find the class that activates the switch, so investigate seems to activate: ng-not-empty
and deactivates ng-empty
the switch link is this .
According to you how should I do ng-if
?