{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/25222","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/25222/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/25222/comments","events_url":"https://api.github.com/repos/angular/angular/issues/25222/events","html_url":"https://github.com/angular/angular/pull/25222","id":346196965,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1MTE5Nzc0","number":25222,"title":"fix(core): allow abstract class as injection token","user":{"login":"trotyl","id":6059170,"node_id":"MDQ6VXNlcjYwNTkxNzA=","avatar_url":"https://avatars0.githubusercontent.com/u/6059170?v=4","gravatar_id":"","url":"https://api.github.com/users/trotyl","html_url":"https://github.com/trotyl","followers_url":"https://api.github.com/users/trotyl/followers","following_url":"https://api.github.com/users/trotyl/following{/other_user}","gists_url":"https://api.github.com/users/trotyl/gists{/gist_id}","starred_url":"https://api.github.com/users/trotyl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trotyl/subscriptions","organizations_url":"https://api.github.com/users/trotyl/orgs","repos_url":"https://api.github.com/users/trotyl/repos","events_url":"https://api.github.com/users/trotyl/events{/privacy}","received_events_url":"https://api.github.com/users/trotyl/received_events","type":"User","site_admin":false},"labels":[{"id":217969169,"node_id":"MDU6TGFiZWwyMTc5NjkxNjk=","url":"https://api.github.com/repos/angular/angular/labels/PR%20action:%20review","name":"PR action: review","color":"fbca04","default":false},{"id":149476251,"node_id":"MDU6TGFiZWwxNDk0NzYyNTE=","url":"https://api.github.com/repos/angular/angular/labels/cla:%20yes","name":"cla: yes","color":"009800","default":false},{"id":375501288,"node_id":"MDU6TGFiZWwzNzU1MDEyODg=","url":"https://api.github.com/repos/angular/angular/labels/comp:%20core%20&%20compiler","name":"comp: core & compiler","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2018-07-31T13:50:39Z","updated_at":"2018-10-02T05:06:16Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/angular/angular/pulls/25222","html_url":"https://github.com/angular/angular/pull/25222","diff_url":"https://github.com/angular/angular/pull/25222.diff","patch_url":"https://github.com/angular/angular/pull/25222.patch"},"body":"closes #23611\r\n\r\n## PR Checklist\r\nPlease check if your PR fulfills the following requirements:\r\n\r\n- [x] The commit message follows our guidelines: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit\r\n- [x] Tests for the changes have been added (for bug fixes / features)\r\n- [ ] Docs have been added / updated (for bug fixes / features)\r\n\r\n\r\n## PR Type\r\nWhat kind of change does this PR introduce?\r\n\r\n<!-- Please check the one that applies to this PR using \"x\". -->\r\n```\r\n[x] Bugfix\r\n[ ] Feature\r\n[ ] Code style update (formatting, local variables)\r\n[ ] Refactoring (no functional changes, no api changes)\r\n[ ] Build related changes\r\n[ ] CI related changes\r\n[ ] Documentation content changes\r\n[ ] angular.io application / infrastructure changes\r\n[ ] Other... Please describe:\r\n```\r\n\r\n## What is the current behavior?\r\n<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->\r\n\r\nIssue Number: https://github.com/angular/angular/issues/23611\r\n\r\nThere're many services used an abstract class as tokens, like:\r\n\r\n+ [ChangeDetectorRef](https://angular.io/api/core/ChangeDetectorRef);\r\n+ [Injector](https://angular.io/api/core/Injector);\r\n+ [NgModuleFactoryLoader](https://angular.io/api/core/NgModuleFactory);\r\n+ [TemplateRef](https://angular.io/api/core/TemplateRef);\r\n+ [ViewContainerRef](https://angular.io/api/core/ViewContainerRef);\r\n+ [RendererFactory2](https://angular.io/api/core/RendererFactory2);\r\n+ [Renderer2](https://angular.io/api/core/Renderer2);\r\n+ [Sanitizer](https://angular.io/api/core/Sanitizer);\r\n+ ...\r\n\r\nAfter https://github.com/angular/angular/pull/13785 merged, `injector.get(ChangeDetectorRef)` would produce a deprecation warning since an `abstract class` is not a `Type`:\r\n\r\nhttps://github.com/angular/angular/blob/3f20a2fb5ad243a85a215cbf70269a769804a224/packages/core/src/di/injector.ts#L71-L75\r\n\r\nAlso in the new `inject()` API, it throws an error as no deprecated `any` fallback:\r\n\r\nhttps://github.com/angular/angular/blob/3f20a2fb5ad243a85a215cbf70269a769804a224/packages/core/src/di/injector.ts#L459-L461\r\n\r\n## What is the new behavior?\r\n\r\nAbstract classes should be allowed as injection tokens, this PR has relaxed typing of `Type` so that abstract class can be now used.\r\n\r\nTechnically any non-class function can also pass the type now as they have an `any` prototype.\r\n\r\n## Does this PR introduce a breaking change?\r\n```\r\n[x] Yes\r\n[ ] No\r\n```\r\n\r\nIf one uses `Type` type and trying to `new` it directly.\r\n\r\n<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. -->\r\n\r\n\r\n## Other information\r\n"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/426150288","html_url":"https://github.com/angular/angular/pull/25222#issuecomment-426150288","issue_url":"https://api.github.com/repos/angular/angular/issues/25222","id":426150288,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNjE1MDI4OA==","user":{"login":"googlebot","id":5384588,"node_id":"MDQ6VXNlcjUzODQ1ODg=","avatar_url":"https://avatars3.githubusercontent.com/u/5384588?v=4","gravatar_id":"","url":"https://api.github.com/users/googlebot","html_url":"https://github.com/googlebot","followers_url":"https://api.github.com/users/googlebot/followers","following_url":"https://api.github.com/users/googlebot/following{/other_user}","gists_url":"https://api.github.com/users/googlebot/gists{/gist_id}","starred_url":"https://api.github.com/users/googlebot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googlebot/subscriptions","organizations_url":"https://api.github.com/users/googlebot/orgs","repos_url":"https://api.github.com/users/googlebot/repos","events_url":"https://api.github.com/users/googlebot/events{/privacy}","received_events_url":"https://api.github.com/users/googlebot/received_events","type":"User","site_admin":false},"created_at":"2018-10-02T05:06:16Z","updated_at":"2018-10-02T05:06:16Z","author_association":"NONE","body":"So there's good news and bad news.\n\n:thumbsup: The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so.  Everything is all good there.\n\n:confused: The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter.  We need to confirm that all authors are ok with their commits being contributed to this project.  Please have them confirm that here in the pull request.\n\n*Note to project maintainer: This is a terminal state, meaning the `cla/google` commit status will not change from this state. It's up to you to confirm consent of all the commit author(s), set the `cla` label to `yes` (if enabled on your project), and then merge this pull request when appropriate.*\n\n<!-- need_author_consent -->"}}
{"actor":{"display_login":"googlebot"}}