|
15 | 15 | Angular offers **lifecycle hooks** |
16 | 16 | that provide visibility into these key life moments and the ability to act when they occur. |
17 | 17 |
|
18 | | - A directive has the same set of lifecycle hooks, minus the hooks that are specific to component content and views. |
| 18 | + A directive has the same set of lifecycle hooks. |
19 | 19 | <br clear="all"> |
20 | 20 | ## Table of Contents |
21 | 21 | * [Overview](#hooks-overview) |
@@ -51,7 +51,7 @@ a#hooks-overview |
51 | 51 | that Angular calls shortly after creating the component: |
52 | 52 | +makeExample('lifecycle-hooks/ts/app/peek-a-boo.component.ts', 'ngOnInit', 'peek-a-boo.component.ts (excerpt)')(format='.') |
53 | 53 | :marked |
54 | | - No directive or component will implement all of the lifecycle hooks and some of the hooks only make sense for components. |
| 54 | + No directive or component will implement all of the lifecycle hooks. |
55 | 55 | Angular only calls a directive/component hook method *if it is defined*. |
56 | 56 |
|
57 | 57 | a#hooks-purpose-timing |
@@ -97,42 +97,34 @@ table(width="100%") |
97 | 97 | td ngAfterContentInit |
98 | 98 | td |
99 | 99 | :marked |
100 | | - Respond after Angular projects external content into the component's view. |
| 100 | + Respond after Angular projects external content into the directive/component's view. |
101 | 101 |
|
102 | 102 | Called _once_ after the first `NgDoCheck`. |
103 | | - |
104 | | - _A component-only hook_. |
105 | | - |
| 103 | + |
106 | 104 | tr(style=top) |
107 | 105 | td ngAfterContentChecked |
108 | 106 | td |
109 | 107 | :marked |
110 | | - Respond after Angular checks the content projected into the component. |
| 108 | + Respond after Angular checks the content projected into the directive/component. |
111 | 109 |
|
112 | 110 | Called after the `ngAfterContentInit` and every subsequent `NgDoCheck`. |
113 | | - |
114 | | - _A component-only hook_. |
115 | | - |
| 111 | + |
116 | 112 | tr(style=top) |
117 | 113 | td ngAfterViewInit |
118 | 114 | td |
119 | 115 | :marked |
120 | | - Respond after Angular initializes the component's views and child views. |
| 116 | + Respond after Angular initializes the directive/component's views and child views. |
121 | 117 |
|
122 | 118 | Called _once_ after the first `ngAfterContentChecked`. |
123 | 119 |
|
124 | | - _A component-only hook_. |
125 | | - |
126 | 120 | tr(style=top) |
127 | 121 | td ngAfterViewChecked |
128 | 122 | td |
129 | 123 | :marked |
130 | | - Respond after Angular checks the component's views and child views. |
| 124 | + Respond after Angular checks the directive/component's views and child views. |
131 | 125 |
|
132 | 126 | Called after the `ngAfterViewInit` and every subsequent `ngAfterContentChecked`. |
133 | 127 |
|
134 | | - _A component-only hook_. |
135 | | - |
136 | 128 | tr(style=top) |
137 | 129 | td ngOnDestroy |
138 | 130 | td |
|
0 commit comments