I am currently working on changing the color of buttons to indicate a selection. When a button is selected, its value is added to an array. If the same button is clicked again, it becomes unselected and its color reverts back to the original state, with its value removed from the array. I have a total of 40 buttons in my demo. You can view the demo through this JSFiddle snippet.
function ctrl($scope) {
$scope.tooth=[];
var count=0;
$scope.setTooth = function(event,code) {
if($scope.tooth.indexOf(code) > -1){
alert("hiii");
$scope.styleO = "styleOne";
$scope.tooth.splice($scope.tooth.indexOf(code), 1);
//$scope.tooth.push();
}else{
$scope.tooth[count]=code;
alert("hello");
$scope.styleT = "styleTwo";
}
}
$scope.setQuadrantsTeeth = function(quadarent){
}
}
Thank you in advance for your help.