Reputation: 705
while in edit mode checkbox is not getting checked!! in html i have this
<input type="checkbox" ng-model="overallfeedback" ng-change="collectFeedback(overallfeedbackElg, $index)" ng-checked="{{collectlistbla[$index]}}">
in ng-change i tried to push model vales in a array...
$scope.collectFeedback = function(oveallfeedbackElg, index){
if($scope.collectlistbla.hasOwnProperty(index))
$scope.collectlistbla.splice(index, 1, oveallfeedbackElg);
else
$scope.collectlistbla.push(oveallfeedbackElg);
console.log($scope.collectlistbla);
};
in edit page while getting responce .....
console.log(response.overallfeedback);//true,true,true,true,true
$scope.collectlistData = response.overallfeedback;
$scope.collectlistbla= $scope.collectlistData.split(',');
console.log($scope.collectlistbla);//["true", "true", "true", "true", "true"]
i must be doing some mistake.. do help... thanks in advance
Upvotes: 1
Views: 186
Reputation: 16801
Inside the ng- tags you don't need to use the {{}} to bind.
Try this:
<input type="checkbox" ng-model="overallfeedback" ng-change="collectFeedback(overallfeedbackElg, $index)" ng-checked="collectlistbla[$index]">
Upvotes: 1