fix(router): remove type bludgeoning of context and outlet when running CanDeactivate (#26496)

Fixes #18253

PR Close #26496
This commit is contained in:
Jason Aden 2018-10-16 15:54:07 -07:00 committed by Kara Erickson
parent e9e804fb02
commit 496372dd30
1 changed files with 2 additions and 2 deletions

View File

@ -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) {