File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
packages/angular/src/lib/legacy/router Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -148,9 +148,14 @@ export class PageRouterOutlet implements OnDestroy {
148
148
}
149
149
150
150
ngOnDestroy ( ) : void {
151
- // Clear accumulated modal view page cache when page-router-outlet
152
- // destroyed on modal view closing
153
- this . parentContexts . onChildOutletDestroyed ( this . name ) ;
151
+ // In the event that the `parentContexts` has changed the outlet
152
+ // via the creation of another outlet, the `onChildOutletDestroyed`
153
+ // will be skipped
154
+ if ( this . parentContexts . getContext ( this . name ) ?. outlet === < any > this ) {
155
+ // Clear accumulated modal view page cache when page-router-outlet
156
+ // destroyed on modal view closing
157
+ this . parentContexts . onChildOutletDestroyed ( this . name ) ;
158
+ }
154
159
155
160
if ( this . outlet ) {
156
161
this . outlet . outletKeys . forEach ( ( key ) => {
You can’t perform that action at this time.
0 commit comments