I display my checkbox list using this code :
<ion-checkbox ng-repeat="item in listPref"
ng-model="item.checked" ng-checked="item.checked">
{{ item.text }}
</ion-checkbox>
This is my listPref:
$scope.listPref = [
{text: 'Cinema'},
{text: 'Sport'},
{text: 'It'} ,
{text: 'Music'},
{text: 'Theater'},
{text: 'Conference'}];
I try this code to get the text of all selected item
for(var i =0 ; i <$scope.listPref.length ; i++){
console.log($scope.listPref[i].checked.text);
}
I get the message undefined Cannot read property 'text' of undefined
at Scope.$scope.pref in my console.
Can someone help me please.