In Angular, I would like to use ngClass and click event to toggle class. I looked through online but some are angular1 and there isn\'t any clear instruction or
ngClass
If you want to toggle text with a toggle button.
HTMLfile which is using bootstrap:
<input class="btn" (click)="muteStream()" type="button" [ngClass]="status ? 'btn-success' : 'btn-danger'" [value]="status ? 'unmute' : 'mute'"/>
TS file:
muteStream() { this.status = !this.status; }