You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(cdk/portal): fix incorrect injector hierarchy with DomPortalOutlet and child environment injectors (#30610)
* fix(cdk/portal): fix incorrect injector hierarchy with `DomPortalOutlet` and child environment injectors
This commit fixes a regression that was introduced in #27427, where the injector hierarchy
did not respect nested environment injectors. `DomPortalOutlet` was always using the application
root as environment injector, yet the element injector may have a custom child environment injector
as ancestor. This child environment injector has to be retrieved manually and passed as environment
injector of the portal component.
Fixes#30609
* refactor(cdk/portal): store application in local variable to avoid repeated non-null assertion
This also has the benefit of minimizing more effectively, as the local variable can be renamed
but the separate field accesses could not.
(cherry picked from commit d0d5de4)
0 commit comments