Currently the context for inject() is only set when the token is seen for the first time. This has two issues: * It should always be set when injecting from that injector, because a constructor may wish to call inject() directly. * If an NgModuleFactory is .create()'d twice, and an ngInjectableDef token is requested from each of them, the second time will fail. This is because the first injection adds the provider definition and calls the factory, and the provider definitions are shared. The second injector will see the provider definition and call the factory to create an instance, but without setting the correct context for inject(). Fixes angular/material2#10586. PR Close #23148
Safari (7+), iOS (7+) and IE mobile (11) are tested on BrowserStack.
Angular
Angular is a development platform for building mobile and desktop web applications using Typescript/JavaScript and other languages.
Quickstart
Want to help?
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues in the hotlist: community-help.
Languages
TypeScript
68.6%
HTML
12.8%
JavaScript
8.4%
Pug
7%
Starlark
1.4%
Other
1.7%