In my project, I need to create a list of checkboxes from an array using classes. There will also be a reset button that, when clicked, will reset all selections. How can I achieve this? Thank you.
$scope.classList=['Class1','Class2','Class3','Class4'];
$scope.selectedClasses={};
$scope.selectedClasses.usall=false;
$scope.selectedClasses.sall=false;
$scope.selectedClasses.classListchecked=false;
$scope.getSubscribedClassList = function(classNam) {
if(classNam==="All"){
$scope.selectedClasses.usall=false;
$scope.selectedClasses.classListchecked=false;
}
else{
$scope.selectedClasses.usall=false;
$scope.selectedClasses.sall=false;
$scope.selectedClasses.classListchecked.push(classNam)
}
}
Here is the link to my fiddle: http://jsfiddle.net/alokranjan39/49cc14yk/38/