Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions aio/content/guide/lifecycle-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ checks it when its data-bound properties change, and destroys it before removing
Angular offers **lifecycle hooks**
that provide visibility into these key life moments and the ability to act when they occur.

A directive has the same set of lifecycle hooks, minus the hooks that are specific to component content and views.
A directive has the same set of lifecycle hooks.

{@a hooks-overview}

Expand All @@ -27,7 +27,7 @@ that Angular calls shortly after creating the component:

<code-example path="lifecycle-hooks/src/app/peek-a-boo.component.ts" region="ngOnInit" title="peek-a-boo.component.ts (excerpt)" linenums="false"></code-example>

No directive or component will implement all of the lifecycle hooks and some of the hooks only make sense for components.
No directive or component will implement all of the lifecycle hooks.
Angular only calls a directive/component hook method *if it is defined*.

{@a hooks-purpose-timing}
Expand Down Expand Up @@ -88,12 +88,10 @@ calls the lifecycle hook methods in the following sequence at specific moments:
</td>
<td>

Respond after Angular projects external content into the component's view.
Respond after Angular projects external content into the component's view / the view that a directive is in.

Called _once_ after the first `ngDoCheck()`.

_A component-only hook_.

</td>
</tr>
<tr style='vertical-align:top'>
Expand All @@ -102,12 +100,10 @@ calls the lifecycle hook methods in the following sequence at specific moments:
</td>
<td>

Respond after Angular checks the content projected into the component.
Respond after Angular checks the content projected into the directive/component.

Called after the `ngAfterContentInit()` and every subsequent `ngDoCheck()`.

_A component-only hook_.

</td>
</tr>
<tr style='vertical-align:top'>
Expand All @@ -116,12 +112,10 @@ calls the lifecycle hook methods in the following sequence at specific moments:
</td>
<td>

Respond after Angular initializes the component's views and child views.
Respond after Angular initializes the component's views and child views / the view that a directive is in.

Called _once_ after the first `ngAfterContentChecked()`.

_A component-only hook_.

</td>
</tr>
<tr style='vertical-align:top'>
Expand All @@ -130,12 +124,10 @@ calls the lifecycle hook methods in the following sequence at specific moments:
</td>
<td>

Respond after Angular checks the component's views and child views.
Respond after Angular checks the component's views and child views / the view that a directive is in.

Called after the `ngAfterViewInit` and every subsequent `ngAfterContentChecked()`.

_A component-only hook_.

</td>
</tr>
<tr style='vertical-align:top'>
Expand Down