Commit d0d5de4
authored
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.1 parent 5a98cc6 commit d0d5de4
2 files changed
+37
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| 69 | + | |
68 | 70 | | |
| 71 | + | |
| 72 | + | |
69 | 73 | | |
70 | | - | |
71 | | - | |
| 74 | + | |
| 75 | + | |
72 | 76 | | |
73 | 77 | | |
74 | 78 | | |
75 | | - | |
| 79 | + | |
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
79 | | - | |
80 | | - | |
| 83 | + | |
| 84 | + | |
81 | 85 | | |
82 | 86 | | |
83 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
614 | 617 | | |
615 | 618 | | |
616 | 619 | | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
617 | 623 | | |
618 | 624 | | |
619 | 625 | | |
| |||
628 | 634 | | |
629 | 635 | | |
630 | 636 | | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
631 | 659 | | |
632 | 660 | | |
633 | 661 | | |
| |||
0 commit comments