From 2ff5bfe139b089d0a89f128c8f4bda0a46343bb8 Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Mon, 24 May 2021 13:54:28 -0700 Subject: [PATCH] docs: fix documentation of guard execution order (#42288) The current documentation of the `CanDeactivate`, `CanActivate`, and `CanActivateChild` guard execution order is incorrect. This commit corrects the documentation. For reference, see https://stackblitz.com/edit/angular-canactivatechild-nqp1f7 Fixes #28082 PR Close #42288 --- aio/content/guide/router-tutorial-toh.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aio/content/guide/router-tutorial-toh.md b/aio/content/guide/router-tutorial-toh.md index 4e6f6f7291..e3cdc5582b 100644 --- a/aio/content/guide/router-tutorial-toh.md +++ b/aio/content/guide/router-tutorial-toh.md @@ -1947,8 +1947,8 @@ The router supports multiple guard interfaces: You can have multiple guards at every level of a routing hierarchy. -The router checks the `CanDeactivate` and `CanActivateChild` guards first, from the deepest child route to the top. -Then it checks the `CanActivate` guards from the top down to the deepest child route. +The router checks the `CanDeactivate` guards first, from the deepest child route to the top. +Then it checks the `CanActivate` and `CanActivateChild` guards from the top down to the deepest child route. If the feature module is loaded asynchronously, the `CanLoad` guard is checked before the module is loaded. If _any_ guard returns false, pending guards that have not completed will be canceled, and the entire navigation is canceled.