mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
docs(docs-infra): change variable names in route guards examples (#44444)
change variable name 'next' to 'route' in route guards examples on developer guides "Routing and Navigation Tutorial: Adding routing to Tour of Heroes" to make it consistent with api docs and subsequent examples. Fixes #44291 PR Close #44444
This commit is contained in:
committed by
Alex Rickabaugh
parent
12f7c85fd0
commit
ab2248e773
@@ -7,7 +7,7 @@ import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angul
|
||||
})
|
||||
export class AuthGuard implements CanActivate {
|
||||
canActivate(
|
||||
next: ActivatedRouteSnapshot,
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot): boolean {
|
||||
console.log('AuthGuard#canActivate called');
|
||||
return true;
|
||||
|
||||
@@ -11,7 +11,7 @@ export class AuthGuard implements CanActivate {
|
||||
constructor(private authService: AuthService, private router: Router) {}
|
||||
|
||||
canActivate(
|
||||
next: ActivatedRouteSnapshot,
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot): true|UrlTree {
|
||||
const url: string = state.url;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user