Below is the code for the list of toggle buttons in which I want to set the first toggle button so that it is on and the rest is off.
<ion-view view-title="Choose language"> <ion-content> <div class="list"> <ion-toggle ng-repeat="item in lists" ng-model="item.checked" ng-checked="item.checked"> {{ item.name }} </ion-toggle> </div> </ion-content> </ion-view> $scope.lists= [ { name: 'List1' }, { name: 'List2' }, { name: 'List3' }, ];
I tried to provide $ scope.item.checked = 'List1' , but did not work. All possible solutions to this problem ..
source share