Created
June 24, 2016 10:58
-
-
Save sonicoder86/6069559dcb05ff14e513930feed2e091 to your computer and use it in GitHub Desktop.
Upgrading to the new Angular 2 router - part 10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// components/hero-detail/hero-detail.component.ts | |
import { Component } from '@angular/core'; | |
import { CanActivate, ComponentInstruction } from '@angular/router-deprecated'; | |
@Component({ ... }) | |
@CanActivate((next: ComponentInstruction, prev: ComponentInstruction) => { | |
return isAuthTokenValid(); | |
}) | |
export class HeroDetailComponent { ... } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment