Hi,
How create CheckBoxList in angularjs .Anyone tell me
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rajeesh MenothRank #118 · 18.4K reputationPosted May 5, 2016, 3:39 AM EDT
Bhuvanesh MohankumarRank #310 · 8.1K reputationPosted May 6, 2016, 12:08 AM EDT
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);
}
};
}]);