Migrating from 2.x to 3.x
New features
Breaking change
Code example
// With promises
router.canActivate(
'profile',
() => isLoggedIn()
.catch(() => ({ redirect: { name: 'login' } }))
);
// With callbacks
router.canActivate(
'profile',
(toState, fromState, done) => {
isLoggedIn()
.then(() => done(null, toState))
.catch(() => done(({ redirect: { name: 'login' } })))
}
);Last updated