E
E
Egor Sh2016-05-05 22:07:39
css
Egor Sh, 2016-05-05 22:07:39

How to hook an event in ANGULAR 2 on the appearance of an element in the ngFor loop?

Hello! I have *ngFor for a div, and this div has a <img>, so I need to catch the moment when each div is created in order to animate on <img>. Tell me how to do it better? I tried using ngAfterViewChecked() , but it confuses me that this thing works like a loop, and it seems to me not right to do some actions related to the appearance of elements in this endless loop.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lega, 2016-05-06
. @EgorkZe

You can make a directive and hang it on the div, it will be called when the div is created.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question