I am trying to execute a function inside ng-change every time a check box is clicked.I need to get the value of model or somehow know which check box was clicked so that I can call another corresponding function for the checked value and also when when that checkbox was unclicked so that I can hode some values
not sure if the approach I am using is correct but this is my code: plunker
HTML
<input type="checkbox" ng-model="data.model" ng-change="onChnage()" class='checkbox'>
JS
$scope.onChnage = function(){
if($scope.index == true){
$scope.indexonClick();
} else if($scope.aggs == true){
$scope.aggsonClick();
} else if($scope.index == false){
console.log('false');
}
};
$scope.indexonClick = function(){
alert('index Clicked!');
}
$scope.aggsonClick = function(){
alert('aggs Clicked!');
};