diff --git a/adev/src/content/guide/components/lifecycle.md b/adev/src/content/guide/components/lifecycle.md index 5f3bd0e7dcb..1caac7bc72b 100644 --- a/adev/src/content/guide/components/lifecycle.md +++ b/adev/src/content/guide/components/lifecycle.md @@ -50,22 +50,22 @@ process. ngDoCheck Runs every time this component is checked for changes. - - ngAfterViewInit - Runs once after the component's view has been initialized. - ngAfterContentInit Runs once after the component's content has been initialized. - - ngAfterViewChecked - Runs every time the component's view has been checked for changes. - ngAfterContentChecked Runs every time this component content has been checked for changes. + + ngAfterViewInit + Runs once after the component's view has been initialized. + + + ngAfterViewChecked + Runs every time the component's view has been checked for changes. + Rendering afterNextRender @@ -173,16 +173,6 @@ defining this hook whenever possible, only using it when you have no alternative During initialization, the first `ngDoCheck` runs after `ngOnInit`. -### ngAfterViewInit - -The `ngAfterViewInit` method runs once after all the children in the component's template (its -_view_) have been initialized. - -You can use this lifecycle hook to read the results of -[view queries](guide/components/queries#view-queries). While you can access the initialized state of -these queries, attempting to change any state in this method results in an -[ExpressionChangedAfterItHasBeenCheckedError](errors/NG0100) - ### ngAfterContentInit The `ngAfterContentInit` method runs once after all the children nested inside the component ( @@ -193,6 +183,29 @@ You can use this lifecycle hook to read the results of state of these queries, attempting to change any state in this method results in an [ExpressionChangedAfterItHasBeenCheckedError](errors/NG0100) +### ngAfterContentChecked + +The `ngAfterContentChecked` method runs every time the children nested inside the component (its +_content_) have been checked for changes. + +This method runs very frequently and can significantly impact your page's performance. Avoid +defining this hook whenever possible, only using it when you have no alternative. + +While you can access the updated state +of [content queries](guide/components/queries#content-queries) here, attempting to +change any state in this method results in +an [ExpressionChangedAfterItHasBeenCheckedError](errors/NG0100). + +### ngAfterViewInit + +The `ngAfterViewInit` method runs once after all the children in the component's template (its +_view_) have been initialized. + +You can use this lifecycle hook to read the results of +[view queries](guide/components/queries#view-queries). While you can access the initialized state of +these queries, attempting to change any state in this method results in an +[ExpressionChangedAfterItHasBeenCheckedError](errors/NG0100) + ### ngAfterViewChecked The `ngAfterViewChecked` method runs every time the children in the component's template (its @@ -206,19 +219,6 @@ here, attempting to change any state in this method results in an [ExpressionChangedAfterItHasBeenCheckedError](errors/NG0100). -### ngAfterContentChecked - -The `ngAfterContentChecked` method runs every time the children nested inside the component (its -_content_) have been checked for changes. - -This method runs very frequently and can significantly impact your page's performance. Avoid -defining this hook whenever possible, only using it when you have no alternative. - -While you can access the updated state -of [content queries](guide/components/queries#content-queries) here, attempting to -change any state in this method results in -an [ExpressionChangedAfterItHasBeenCheckedError](errors/NG0100). - ### afterRender and afterNextRender The `afterRender` and `afterNextRender` functions let you register a **render callback** to be