Skip to content

Commit 4be9255

Browse files
committed
docs(lifecycle-hooks): update event hooks to match directives capabilities
Minor documentation update to include event hooks that were assumed to only work on components. Closes angular/angular#10221
1 parent 061e50f commit 4be9255

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

public/docs/ts/latest/guide/lifecycle-hooks.jade

+8-16
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ figure
1515
Angular offers **lifecycle hooks**
1616
that provide visibility into these key life moments and the ability to act when they occur.
1717

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.
1919
<br clear="all">
2020
## Table of Contents
2121
* [Overview](#hooks-overview)
@@ -51,7 +51,7 @@ a#hooks-overview
5151
that Angular calls shortly after creating the component:
5252
+makeExample('lifecycle-hooks/ts/app/peek-a-boo.component.ts', 'ngOnInit', 'peek-a-boo.component.ts (excerpt)')(format='.')
5353
: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.
5555
Angular only calls a directive/component hook method *if it is defined*.
5656

5757
a#hooks-purpose-timing
@@ -97,42 +97,34 @@ table(width="100%")
9797
td ngAfterContentInit
9898
td
9999
: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.
101101

102102
Called _once_ after the first `NgDoCheck`.
103-
104-
_A component-only hook_.
105-
103+
106104
tr(style=top)
107105
td ngAfterContentChecked
108106
td
109107
:marked
110-
Respond after Angular checks the content projected into the component.
108+
Respond after Angular checks the content projected into the directive/component.
111109

112110
Called after the `ngAfterContentInit` and every subsequent `NgDoCheck`.
113-
114-
_A component-only hook_.
115-
111+
116112
tr(style=top)
117113
td ngAfterViewInit
118114
td
119115
: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.
121117

122118
Called _once_ after the first `ngAfterContentChecked`.
123119

124-
_A component-only hook_.
125-
126120
tr(style=top)
127121
td ngAfterViewChecked
128122
td
129123
: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.
131125

132126
Called after the `ngAfterViewInit` and every subsequent `ngAfterContentChecked`.
133127

134-
_A component-only hook_.
135-
136128
tr(style=top)
137129
td ngOnDestroy
138130
td

0 commit comments

Comments
 (0)