Skip to content

Commit

Permalink
fixup! fix(router): fix angular#49457 outlet activating with old info
Browse files Browse the repository at this point in the history
  • Loading branch information
jancabadaj authored and atscott committed Mar 17, 2023
1 parent 19bbbe1 commit 3de42aa
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/router/src/operators/activate_routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,13 @@ export class ActivateRoutes {
this.deactivateRouteAndItsChildren(children[childOutlet], contexts);
}

if (context && context.outlet) {
// Destroy the component
context.outlet.deactivate();
// Destroy the contexts for all the outlets that were in the component
context.children.onOutletDeactivated();
}

if (context) {
if (context.outlet) {
// Destroy the component
context.outlet.deactivate();
// Destroy the contexts for all the outlets that were in the component
context.children.onOutletDeactivated();
}
// Clear the information about the attached component on the context but keep the reference to
// the outlet. Clear even if outlet was not yet activated to avoid activating later with old
// info
Expand Down

0 comments on commit 3de42aa

Please sign in to comment.