Pramod Thakur

Pramod Thakur

  • NA
  • 7.3k
  • 789.3k

Bind checkbox while edit the product angularJS

Aug 16 2015 8:45 PM
    
I am new to angularJs and facing some issue while i want to bind checkbox list with auto-selected property when page is get render.
 
<tr ng-repeat="pr in ProdList">
<td><input type="checkbox" id="{{pr.Id}}" value="{{pr.Id}}" name="chkProd" /></td>
<td>{{pr.Name}}</td>
</tr>
 
<script>
var app = angular.module("myApp", []);
app.controller('catContlr', function ($scope, $http) {
var results = [];
$http.get('Home/GetSelectedValue')
.success(function (response) {
$scope.item = response;
});
angular.forEach($scope.item.ProdList, function (c) {
if (c.Active) {
results.push(c);
}
});
return results;
}
</script>
Please help me

Answers (1)