ng class if clicked code example
Example: angular onclick toggle class
// component.ts
toggleClass: boolean = false;
// component.html
<button (click)="toggleClass = !toggleClass" [ngClass]="{ 'button--grey': !toggleClass }">
Confirm
</button>
// component.ts
toggleClass: boolean = false;
// component.html
<button (click)="toggleClass = !toggleClass" [ngClass]="{ 'button--grey': !toggleClass }">
Confirm
</button>