There are two pieces of code
<app-card [model] = "models [0]"> </app-card> When rendering and clicking on the button, additional content opens. Before click After click
<app-card [model] = "models [0]"> </app-card>
<app-card * ngFor = "let model of models" [model] = "model"> </app-card> Using ngFor, the button does nothing, while the method that handles the event is triggered. image
<app-card * ngFor = "let model of models" [model] = "model"> </app-card>
How to make cards work correctly with ngFor?
2.1m questions
2.1m answers
60 comments
57.0k users