I have list of groups and generate that group list in HTML with ng-repeat(list of buttons) and its working perfectly. But in case when i am trying to disable some buttons with ng-disabled by call function to check the value, i just amazed my loop and buttons showing correctly but ng-disable="myfunc()" called many times.
My Code:
<button class="button button-block button-calm btn-shape" ng-click="startSurvey(group.survey_id,group.id)" ng-repeat="group in groupList" ng-disabled="checkGroupCompleted($index)">
{{group.title}}
</button>
Group List:
Controller:
$scope.checkGroupCompleted = function(groupID){
console.log(groupID);
}
Console Output:
I just need similar functionality: JSFiddle


truefor enabled andfalsefor disabled.