89b44d1900
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 |
||
---|---|---|
.. | ||
BUILD.bazel | ||
component-factory-strategy_spec.ts | ||
create-custom-element_spec.ts | ||
extract-projectable-nodes_spec.ts | ||
slots_spec.ts | ||
utils_spec.ts |