Update reference doc for router guards and resolvers#38079
Conversation
|
You can preview 4a44f2d at https://pr38079-4a44f2d.ngbuilds.io/. |
There was a problem hiding this comment.
| * When both guard functions and resolvers are specified, the resolvers are not executed until | |
| * all guards for a route tree have run and succeeded. | |
| * When both guards and resolvers are specified, the resolvers are not executed until | |
| * all guards have run and succeeded. |
There was a problem hiding this comment.
This is actually confusing, since we would only run the guards/resolvers for the tree being activated. Maybe use a concrete example instead, something like:
{
path: 'base'
canActivate: [BaseGuard],
resolve: {data: BaseDataResolver}
children: [
{
path: 'child',
guards: [ChildGuard],
resolve: {childData: ChildDataResolver}
}
]
}
Order of execution is BaseGuard, ChildGuard, BaseDataResolver, ChildDataResolver
Here's an example: https://stackblitz.com/edit/angular-ivy-router-base-rgemdd?file=src%2Fapp%2Fapp.module.ts
|
You can preview 5c76197 at https://pr38079-5c76197.ngbuilds.io/. |
|
The clarification in the docs here resolves #37625 |
Complete and clarify descriptions and example of the guard and resolver functions in Router API documentation.
b518d84 to
034b59e
Compare
|
You can preview 910e49f at https://pr38079-910e49f.ngbuilds.io/. |
|
You can preview 034b59e at https://pr38079-034b59e.ngbuilds.io/. |
|
Doc only -- should not need g3 |
Complete and clarify descriptions and example of the guard and resolver functions in Router API documentation. PR Close #38079
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
…8079) Complete and clarify descriptions and example of the guard and resolver functions in Router API documentation. PR Close angular#38079
Complete and clarify descriptions and examples of the guard and resolver functions in Router API documentation.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Examples are not described and the usage descriptions are incomplete
Issue Number: N/A
What is the new behavior?
Corrects language style and adds descriptions of examples
Does this PR introduce a breaking change?