{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/10221","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/10221/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/10221/comments","events_url":"https://api.github.com/repos/angular/angular/issues/10221/events","html_url":"https://github.com/angular/angular/issues/10221","id":166923564,"number":10221,"title":"Directives support \"VIEW\" lifecycle hooks, the docs say they dont","user":{"login":"shlomiassaf","id":5377501,"avatar_url":"https://avatars.githubusercontent.com/u/5377501?v=3","gravatar_id":"","url":"https://api.github.com/users/shlomiassaf","html_url":"https://github.com/shlomiassaf","followers_url":"https://api.github.com/users/shlomiassaf/followers","following_url":"https://api.github.com/users/shlomiassaf/following{/other_user}","gists_url":"https://api.github.com/users/shlomiassaf/gists{/gist_id}","starred_url":"https://api.github.com/users/shlomiassaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shlomiassaf/subscriptions","organizations_url":"https://api.github.com/users/shlomiassaf/orgs","repos_url":"https://api.github.com/users/shlomiassaf/repos","events_url":"https://api.github.com/users/shlomiassaf/events{/privacy}","received_events_url":"https://api.github.com/users/shlomiassaf/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular/angular/labels/comp:%20core%20&%20compiler","name":"comp: core & compiler","color":"c7def8"},{"url":"https://api.github.com/repos/angular/angular/labels/comp:%20docs","name":"comp: docs","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-21T21:35:41Z","updated_at":"2016-10-04T20:47:33Z","closed_at":null,"body":"**I'm submitting a ...**  Hard to say....\r\n\r\n**Current behavior**\r\n- ngAfterContentInit\r\n- ngAfterContentChecked\r\n- ngAfterViewInit\r\n- ngAfterViewChecked\r\n\r\nFire on directives.\r\n\r\n**Expected/desired behavior**\r\nAccording to the [docs](https://angular.io/docs/ts/latest/guide/lifecycle-hooks.html#!#hooks-overview) these lifecycle hooks are **Components only**\r\n\r\n- ngAfterContentInit\r\n- ngAfterContentChecked\r\n- ngAfterViewInit\r\n- ngAfterViewChecked\r\n\r\nThe compiler registers them to invoke on directives as well.\r\nThe 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 `detectChangesInternal` method.\r\n\r\nHere's a [plunker](https://plnkr.co/edit/7jXGGE?p=preview)\r\nI can only assume the docs are incorrect...\r\n"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/251508566","html_url":"https://github.com/angular/angular/issues/10221#issuecomment-251508566","issue_url":"https://api.github.com/repos/angular/angular/issues/10221","id":251508566,"user":{"login":"tbosch","id":690815,"avatar_url":"https://avatars.githubusercontent.com/u/690815?v=3","gravatar_id":"","url":"https://api.github.com/users/tbosch","html_url":"https://github.com/tbosch","followers_url":"https://api.github.com/users/tbosch/followers","following_url":"https://api.github.com/users/tbosch/following{/other_user}","gists_url":"https://api.github.com/users/tbosch/gists{/gist_id}","starred_url":"https://api.github.com/users/tbosch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbosch/subscriptions","organizations_url":"https://api.github.com/users/tbosch/orgs","repos_url":"https://api.github.com/users/tbosch/repos","events_url":"https://api.github.com/users/tbosch/events{/privacy}","received_events_url":"https://api.github.com/users/tbosch/received_events","type":"User","site_admin":false},"created_at":"2016-10-04T20:47:33Z","updated_at":"2016-10-04T20:47:33Z","body":"`ngAfterContentInit/Checked` is also valid for directives, as they can also use `@ContentChildren` -> docs need to be changed. \r\n\r\n`ngAfterViewInit` also fires for directives so that they can be notified when all components in the template that they are in have been processed."}}
{"actor":{"display_login":"tbosch"}}