mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
parent
055282f156
commit
73f017bad9
1 changed files with 3 additions and 1 deletions
|
|
@ -400,7 +400,9 @@ class PreActivation {
|
|||
if (s instanceof CanActivate) {
|
||||
return this.runCanActivate(s.route);
|
||||
} else if (s instanceof CanDeactivate) {
|
||||
return this.runCanDeactivate(s.component, s.route);
|
||||
// workaround https://github.com/Microsoft/TypeScript/issues/7271
|
||||
const s2 = s as CanDeactivate;
|
||||
return this.runCanDeactivate(s2.component, s2.route);
|
||||
} else {
|
||||
throw new Error('Cannot be reached');
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue