Hi,
How create CheckBoxList in angularjs .Anyone tell me
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Rajeesh MenothPosted May 5, 2016, 7:39 AM
Bhuvanesh MohankumarPosted May 6, 2016, 4:08 AM
Hi Thiruppathi,
// fruits
$scope.fruits = ['apple', 'orange', 'pear', 'naartjie'];
$scope.selection = ['apple', 'pear'];
$scope.toggleSelection = function toggleSelection(fruitName) {
var idx = $scope.selection.indexOf(fruitName);
if (idx > -1) {
$scope.selection.splice(idx, 1);
}
else {
$scope.selection.push(fruitName);
}
};
}]);