{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/8991","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/8991/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/8991/comments","events_url":"https://api.github.com/repos/angular/angular/issues/8991/events","html_url":"https://github.com/angular/angular/pull/8991","id":158300419,"number":8991,"title":"fix(DI): make DI work on Components/Directives inherited from Angular","user":{"login":"hannahhoward","id":1450680,"avatar_url":"https://avatars.githubusercontent.com/u/1450680?v=3","gravatar_id":"","url":"https://api.github.com/users/hannahhoward","html_url":"https://github.com/hannahhoward","followers_url":"https://api.github.com/users/hannahhoward/followers","following_url":"https://api.github.com/users/hannahhoward/following{/other_user}","gists_url":"https://api.github.com/users/hannahhoward/gists{/gist_id}","starred_url":"https://api.github.com/users/hannahhoward/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hannahhoward/subscriptions","organizations_url":"https://api.github.com/users/hannahhoward/orgs","repos_url":"https://api.github.com/users/hannahhoward/repos","events_url":"https://api.github.com/users/hannahhoward/events{/privacy}","received_events_url":"https://api.github.com/users/hannahhoward/received_events","type":"User","site_admin":false},"labels":[{"id":149476251,"url":"https://api.github.com/repos/angular/angular/labels/cla:%20yes","name":"cla: yes","color":"009800","default":false},{"id":375501288,"url":"https://api.github.com/repos/angular/angular/labels/comp:%20core%20&%20compiler","name":"comp: core & compiler","color":"c7def8","default":false},{"id":135584804,"url":"https://api.github.com/repos/angular/angular/labels/pr_action:%20cleanup","name":"pr_action: cleanup","color":"e11d21","default":false},{"id":217969169,"url":"https://api.github.com/repos/angular/angular/labels/pr_action:%20review","name":"pr_action: review","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":{"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},"assignees":[{"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}],"milestone":null,"comments":7,"created_at":"2016-06-03T06:34:17Z","updated_at":"2016-11-10T01:02:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/angular/angular/pulls/8991","html_url":"https://github.com/angular/angular/pull/8991","diff_url":"https://github.com/angular/angular/pull/8991.diff","patch_url":"https://github.com/angular/angular/pull/8991.patch"},"body":"**Please check if the PR fulfills these requirements**\n- [X ] The commit message follows our guidelines: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit-message-format\n- [X ] Tests for the changes have been added (for bug fixes / features)\n- [X ] Docs have been added / updated (for bug fixes / features)\n\n**What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...)\n- [X ] Bugfix\n- [ ] Feature\n- [ ] Code style update (formatting, local variables)\n- [ ] Refactoring (no functional changes, no api changes)\n- [ ] Build related changes\n- [ ] CI related changes\n- [ ] Other... Please describe:\n\n**What is the current behavior?** (You can also link to an open issue here)\n\nSee #8700 \nWhen an application attempts to extend a built-in Angular 2 Component, Directive, or Service, unless it is using the Angular Template Compiler instead of the vanilla Typescript, DI does not work properly\n\n**What is the new behavior?**\n\nFixes #8700\nAn application can extend a built-in Angular 2 Component, Directive, or Service, using a standard typescript compiler and DI will still work.\n\n**Does this PR introduce a breaking change?**\n- [ ] Yes\n- [ X] No\n\nIf this PR contains a breaking change, please describe the impact and migration path for existing applications: ...\n\n**Other information**:\n\nMakes it DI work when inheriting Components/Directives/Services from built-in Angular 2\nComponents/Directives/Services while using standard typescript compiler\n\nFixes #8700 \n\nExplanation of fix:\n\nCurrently, the reflector always prioritizes the properties emitted by tsickle over any metadata generated through decorators. In a scenario where one is extending a built Angular 2 component, while using standard typescript compilation, it will have tsickle properties from the built-in component and decorator metadata from the extending component. The solution is to use the Reflect.metadata API's getOwnMetadata method to see if metadata is present on the subclass that extends Angular, and prioritize that metadata over tsickle properties if it is present.\n\nBuilding a test for this was not trivial, and the only way I could think to do it was with an E2E_test -- see modules/playground/inherit_from_angular. This also neccesitated modifiying the build script to copy the typescript library to dist/all/playground/vendor.\n\nThere may be code clean-up neccesary here - I am open to suggestions. But this at minimum illustrates the problem and one path to a solution.\n"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/259572900","html_url":"https://github.com/angular/angular/pull/8991#issuecomment-259572900","issue_url":"https://api.github.com/repos/angular/angular/issues/8991","id":259572900,"user":{"login":"laco0416","id":1529180,"avatar_url":"https://avatars.githubusercontent.com/u/1529180?v=3","gravatar_id":"","url":"https://api.github.com/users/laco0416","html_url":"https://github.com/laco0416","followers_url":"https://api.github.com/users/laco0416/followers","following_url":"https://api.github.com/users/laco0416/following{/other_user}","gists_url":"https://api.github.com/users/laco0416/gists{/gist_id}","starred_url":"https://api.github.com/users/laco0416/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laco0416/subscriptions","organizations_url":"https://api.github.com/users/laco0416/orgs","repos_url":"https://api.github.com/users/laco0416/repos","events_url":"https://api.github.com/users/laco0416/events{/privacy}","received_events_url":"https://api.github.com/users/laco0416/received_events","type":"User","site_admin":false},"created_at":"2016-11-10T01:02:28Z","updated_at":"2016-11-10T01:02:28Z","body":"@vicb sure. I'll wait until this weekend. "}}
{"actor":{"display_login":"laco0416"}}