Skip to content

Commit

Permalink
fix(router): remove type bludgeoning of context and outlet when runni…
Browse files Browse the repository at this point in the history
…ng CanDeactivate

Fixes angular#18253
  • Loading branch information
jasonaden committed Oct 16, 2018
1 parent 0f7d2ca commit b772d3e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/router/src/utils/preactivation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ function getRouteGuards(
}

if (shouldRun) {
const outlet = context !.outlet !;
checks.canDeactivateChecks.push(new CanDeactivate(outlet.component, curr));
const component = context && context.outlet && context.outlet.component || null;
checks.canDeactivateChecks.push(new CanDeactivate(component, curr));
}
} else {
if (curr) {
Expand Down

0 comments on commit b772d3e

Please sign in to comment.