fix(typescript): make router compile with typescript@next

fixes #9731
This commit is contained in:
Alex Eagle 2016-06-30 11:40:05 -07:00
parent 055282f156
commit 73f017bad9
1 changed files with 3 additions and 1 deletions

View File

@ -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');
}