<p dir="auto"><strong>I'm submitting a ...</strong>  (check one with "x")</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[x] bug report
[ ] feature request
[ ] support request "><pre class="notranslate"><code class="notranslate">[x] bug report
[ ] feature request
[ ] support request 
</code></pre></div>
<p dir="auto"><strong>Current behavior</strong><br>
See <a href="https://angular.io/docs/ts/latest/api/core/index/ContentChild-var.html" rel="nofollow">API guide for <code class="notranslate">ContentChild</code></a>.</p>
<p dir="auto">The example in that guide page attempts to illustrate <code class="notranslate">ContentChild</code> by showing a <strong>directive</strong> that extracts child content.</p>
<p dir="auto">How does a directive - which lacks a template - extract child content (or a child view)? From what? The example itself is unclear, perhaps nonsense?</p>
<p dir="auto">It did reveal that <code class="notranslate">ngAfterContent...</code> and <code class="notranslate">ngAfterView...</code> hooks are called on a directive. <strong>Why?</strong>  How would I use them?</p>
<p dir="auto">This all came up in <a href="https://angular.io/docs/ts/latest/api/core/index/ContentChild-var.html" rel="nofollow">an issue filed in <code class="notranslate">angular.io</code> </a> about our lifecycle hook documentation where I asserted that these hooks really don't apply to directives.</p>
<p dir="auto">I replied with some sample code there ... code that is a slight tweak of that documentation <a href="https://angular.io/resources/live-examples/lifecycle-hooks/ts/plnkr.html" rel="nofollow">chapter's plunker</a>.</p>
<p dir="auto">Can elaborate if need be.</p>
<p dir="auto"><strong>I'm submitting a ...</strong>  Hard to say....</p>
<p dir="auto"><strong>Current behavior</strong></p>
<ul dir="auto">
<li>ngAfterContentInit</li>
<li>ngAfterContentChecked</li>
<li>ngAfterViewInit</li>
<li>ngAfterViewChecked</li>
</ul>
<p dir="auto">Fire on directives.</p>
<p dir="auto"><strong>Expected/desired behavior</strong><br>
According to the <a href="https://angular.io/docs/ts/latest/guide/lifecycle-hooks.html#!#hooks-overview" rel="nofollow">docs</a> these lifecycle hooks are <strong>Components only</strong></p>
<ul dir="auto">
<li>ngAfterContentInit</li>
<li>ngAfterContentChecked</li>
<li>ngAfterViewInit</li>
<li>ngAfterViewChecked</li>
</ul>
<p dir="auto">The compiler registers them to invoke on directives as well.<br>
The view factory of a component containing a directive will invoke the lifecycle hook on that directive. This is not by change, this is by intent from the compiler as it requires accessing the directive instance and calling the hook within the <code class="notranslate">detectChangesInternal</code> method.</p>
<p dir="auto">Here's a <a href="https://plnkr.co/edit/7jXGGE?p=preview" rel="nofollow">plunker</a><br>
I can only assume the docs are incorrect...</p>