G
G
guerragro2019-04-08 08:40:02
Angular
guerragro, 2019-04-08 08:40:02

Why is the ng-container event not working?

<ng-container *ngFor="let ware of task.wares" (click)="deleteWares(ware)">
<tr></tr>
</ng-container>

Why is the event not working? when you wrap it in a div, everything is ok.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Shvets, 2019-04-08
@guerragro

ng-container does not create an html element, there is nothing to catch the click event.
If you have a table, then it is more logical to do

<tr *ngFor="let ware of task.wares" (click)="deleteWares(ware)">
<ng-container></ng-container>
</tr>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question