docs: add note about redirects after absolute redirect (#42277)

This commit addresses the documentation portion of #19069.

PR Close #42277
This commit is contained in:
Andrew Scott 2021-05-24 09:22:06 -07:00 committed by Zach Arend
parent 83fe721c78
commit 6da0c97423
2 changed files with 5 additions and 1 deletions

View File

@ -95,7 +95,8 @@ class ApplyRedirects {
}));
return urlTrees$.pipe(catchError((e: any) => {
if (e instanceof AbsoluteRedirect) {
// after an absolute redirect we do not apply any more redirects!
// After an absolute redirect we do not apply any more redirects!
// If this implementation changes, update the documentation note in `redirectTo`.
this.allowRedirects = false;
// we need to run matching, so we can fetch all lazy-loaded modules
return this.match(e.urlTree);

View File

@ -422,7 +422,10 @@ export interface Route {
component?: Type<any>;
/**
* A URL to redirect to when the path matches.
*
* Absolute if the URL begins with a slash (/), otherwise relative to the path URL.
* Note that no further redirects are evaluated after an absolute redirect.
*
* When not present, router does not redirect.
*/
redirectTo?: string;