Issue:
<button *ngFor="let button of buttons" [ngClass]="{'active': isClicked}" (click)="isClicked = !isClicked"
Description:
A total of 10 buttons are displayed on the screen.
When I click on button number 1, each button receives the class ".active".
Preferred Outcome:
Upon clicking button number 1: it should receive the class ".active".
Upon clicking button number 3: it should receive the class ".active".
Upon clicking button number 6: it should receive the class ".active".
Result:
Button 1, Button 3, and Button 6 will be assigned the class ".active"
Any suggestions on how to achieve this?
Find Plunker demo here: https://plnkr.co/edit/lX3DjN46STmo6gfBkPCc?p=preview