Reputation: 77
My code :
<label ng-class="[getClasscolor(0)]"><input class="opened" ng-checked="getStatut(data.statut_cas_id_statut1, 0)" ng-model="data.statut_cas_id_statut1" value="0" type="checkbox"> Open </label>
I would check this checkbox by default and call the function getStatut by default. How can I do that ? I'm starting with angularjs
Upvotes: 1
Views: 38
Reputation: 172428
You can try like this:
<div ng-app="">
<input type="checkbox" ng-model="checked" ng-init="checked=true">
</div>
You can try to use ng-change="!key || getStatut(data.statut_cas_id_statut1, 0)"
So it would be like
<div ng-app="">
<input type="checkbox" ng-model="checked" ng-init="checked=true"
ng-change="!key || getStatut(data.statut_cas_id_statut1, 0)">
</div>
Upvotes: 1