SHARE
TWEET

Untitled

a guest Jan 22nd, 2016 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   activate(instruction: ComponentInstruction) {
  2.     var url = this.parentRouter.lastNavigationAttempt;
  3.  
  4.     console.log("Route change: " + url)
  5.  
  6.     if (!this.publicRoutes[url] && !localStorage.getItem('tokenId')) {
  7.       console.log(url)
  8.       // todo: redirect to Login, may be there a better way?
  9.       this.parentRouter.navigateByUrl('/login');
  10.     }
  11.     return super.activate(instruction);
  12.   }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top