1// component.ts
2toggleClass: boolean = false;
3
4// component.html
5<button (click)="toggleClass = !toggleClass" [ngClass]="{ 'button--grey': !toggleClass }">
6 Confirm
7</button>
1$scope.toggle = false;
2
3
4<button id="btn" ng-click="toggle = !toggle" ng-class="{'red' : toggle}">Change Class</button>