use ngclass use button toggle in angular code example
Example: angular ng-click toggle class
$scope.toggle = false;
<button id="btn" ng-click="toggle = !toggle" ng-class="{'red' : toggle}">Change Class</button>
$scope.toggle = false;
<button id="btn" ng-click="toggle = !toggle" ng-class="{'red' : toggle}">Change Class</button>