What is the difference between AfterContentChecked and AfterViewChecked in Angular2?

I'm trying to find out what exactly is the difference between these two lifecycle hooks? Can someone explain to me how to use them with any simple example? I just want when exactly should I implement these interfaces?

Thank.

Greetings.

+4
source share
1 answer
  • view refers to the component template

  • content refers to the abandoned children of the current component (which can be translated using the element <ng-content></ng-content>).

See https://angular.io/docs/ts/latest/guide/lifecycle-hooks.html#!#afterview for details

+4
source

Source: https://habr.com/ru/post/1655884/


All Articles