Search code examples
angulartemplatesshow

How to show div line by line - template Angular


I have an angular template displaying rows. I added a button to display some informations on the current line. The problem is : when I click on the button line 1, the informations was showed on all the lines.

I put here a little snippet of the code reproducing my problem

https://stackblitz.com/edit/angular-nmhrty

Thanks in advance !


Solution

  • Somehow you need to control which button did you click, I put this information inside de array, I hope it helps you:

    https://stackblitz.com/edit/angular-bawglg?file=src/app/app.component.ts