Skip to content

Instantly share code, notes, and snippets.

@sliceofbytes
Created April 26, 2018 19:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sliceofbytes/8762b5a86ea7ece1e3c4f7bc8463939e to your computer and use it in GitHub Desktop.
Save sliceofbytes/8762b5a86ea7ece1e3c4f7bc8463939e to your computer and use it in GitHub Desktop.
Route from activate
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> | boolean {
if (someCondition) {
this.router.navigate(['not-allowed']);
return false;
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment