I am doing like this
<div class="tiles" ng-repeat="stat in states" ng-click="select(stat)" ng-class="{active: isActive(stat)}">
....
</div>
//controller
$scope.select= function(item) {
$scope.selected = item;
};
$scope.isActive = function(item) {
return $scope.selected === item;
};
clicking on tiles it is adding active class and clicking on other tiles removing from first tiles and adding to another tiles.It is working as expected .But what i am trying to achieve is clicking on same tiles again i have to remove active class ,clicking on again i have to add like toggling .But no idea how to achieve this .Please help