
Previously, the correct behavior of Angular custom elements relied on the constructor being called (and thus the `injector` property being initialized). However, some polyfills (e.g. `document-register-element`) do not call the constructor of custom elements, which resulted in the `injector` property being undefined and the `NgElementStrategy` failing to be instantiated. This commit fixes it by being tolerant to the `injector` property being undefined and falling back to the injector passed to the `createCustomElement()` config. NOTE: We don't have proper tests exercising the situation where the constructor is not called. For now this is tested using a Google internal test suite (which is how this issue was caught). This commit also adds a rudimentary unit test to emulate this situation. PR Close #36114
Angular
Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages.
Quickstart
Changelog
Learn about the latest improvements.
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.
Description
Languages
TypeScript
86.3%
JavaScript
8.5%
HTML
1.8%
Starlark
1.7%
CSS
1%
Other
0.6%