From f5d0c80622ec0981d4a2f55b60aeb5ce51cc1301 Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Wed, 9 Nov 2022 09:53:32 -0800 Subject: [PATCH] docs(router): small adjustments to router docs (#48009) * Update extractedUrl documentation to point to the correct extract method * Remove authService.redirectUrl from tour of heroes (it's not used anywhere) PR Close #48009 --- aio/content/examples/router/src/app/auth/auth.guard.2.ts | 3 --- aio/content/examples/router/src/app/auth/auth.guard.3.ts | 3 --- aio/content/examples/router/src/app/auth/auth.guard.4.ts | 5 ----- aio/content/examples/router/src/app/auth/auth.guard.ts | 5 ----- packages/router/src/router.ts | 2 +- 5 files changed, 1 insertion(+), 17 deletions(-) diff --git a/aio/content/examples/router/src/app/auth/auth.guard.2.ts b/aio/content/examples/router/src/app/auth/auth.guard.2.ts index bddc156d061..6a286fe5f97 100644 --- a/aio/content/examples/router/src/app/auth/auth.guard.2.ts +++ b/aio/content/examples/router/src/app/auth/auth.guard.2.ts @@ -15,9 +15,6 @@ export const authGuard: CanMatchFn|CanActivateFn = () => { return true; } - const url = router.getCurrentNavigation()!.extractedUrl.toString(); - // Store the attempted URL for redirecting - authService.redirectUrl = url; // Redirect to the login page return router.parseUrl('/login'); }; diff --git a/aio/content/examples/router/src/app/auth/auth.guard.3.ts b/aio/content/examples/router/src/app/auth/auth.guard.3.ts index dd8b4db6011..67b5502d7c0 100644 --- a/aio/content/examples/router/src/app/auth/auth.guard.3.ts +++ b/aio/content/examples/router/src/app/auth/auth.guard.3.ts @@ -15,9 +15,6 @@ export const authGuard: CanMatchFn|CanActivateFn|CanActivateChildFn = () => { return true; } - const url = router.getCurrentNavigation()!.extractedUrl.toString(); - // Store the attempted URL for redirecting - authService.redirectUrl = url; // Redirect to the login page return router.parseUrl('/login'); }; diff --git a/aio/content/examples/router/src/app/auth/auth.guard.4.ts b/aio/content/examples/router/src/app/auth/auth.guard.4.ts index fbc5515597e..4a270b91e26 100644 --- a/aio/content/examples/router/src/app/auth/auth.guard.4.ts +++ b/aio/content/examples/router/src/app/auth/auth.guard.4.ts @@ -17,11 +17,6 @@ export const authGuard: CanMatchFn|CanActivateFn|CanActivateChildFn = () => { return true; } - const url = router.getCurrentNavigation()!.extractedUrl.toString(); - - // Store the attempted URL for redirecting - authService.redirectUrl = url; - // Create a dummy session id const sessionId = 123456789; diff --git a/aio/content/examples/router/src/app/auth/auth.guard.ts b/aio/content/examples/router/src/app/auth/auth.guard.ts index e0a47419b00..fc400e1d1c7 100644 --- a/aio/content/examples/router/src/app/auth/auth.guard.ts +++ b/aio/content/examples/router/src/app/auth/auth.guard.ts @@ -18,11 +18,6 @@ export const authGuard: CanMatchFn|CanActivateChildFn|CanActivateFn|CanLoadFn = return true; } - const url = router.getCurrentNavigation()!.extractedUrl.toString(); - - // Store the attempted URL for redirecting - authService.redirectUrl = url; - // Create a dummy session id const sessionId = 123456789; diff --git a/packages/router/src/router.ts b/packages/router/src/router.ts index f7f665f4401..ca1b24cf737 100644 --- a/packages/router/src/router.ts +++ b/packages/router/src/router.ts @@ -218,7 +218,7 @@ export interface Navigation { */ initialUrl: UrlTree; /** - * The initial target URL after being parsed with `UrlSerializer.extract()`. + * The initial target URL after being parsed with `UrlHandlingStrategy.extract()`. */ extractedUrl: UrlTree; /**