ngAfterViewChecked () will be called as soon as the DOM tree receives any changes.
So, if the DOM tree has been changed many times, the ngAfterViewChecked () method will be called many times.
Suggest not to include business logic in this method. But instead, only the update logic associated with the update is used, for example, to scroll down the window if a new message arrives.
source
share