I have:
When you use (click)="isClicked = !isClicked"
, you set a single isClicked
property on the component that is used by all buttons. Instead, expand your buttons
array to an array of objects:
buttons = [
{ text: 'item1', isClicked: false },
{ text: 'item2', isClicked: false },
{ text: 'item3', isClicked: false },
// ...
]
With this, each button has its own isClicked
property, which you can use like this:
Here's an updated plunker.