Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 7338e43

Browse files
Josh68petebacondarwin
authored andcommitted
docs(guide/component-router): fix incorrect hook name for $canActivate
The hook will most likely be named back to `$routerCanActivate` in the future, but for now this change is accurate. Closes #14237
1 parent 119ed07 commit 7338e43

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/content/guide/component-router.ngdoc

+4-4
Original file line numberDiff line numberDiff line change
@@ -956,17 +956,17 @@ respectively.
956956

957957
**How do I prevent navigation from occurring?**
958958

959-
Each **Component** can provide the `$routerCanActivate` and `$routerCanDeactivate` **Lifecycle Hooks**. The
960-
`$routerCanDeactivate` hook is an instance method on the **Component**. The `$routerCanActivate` hook is a
961-
static method defined on either the **Component Definition Object** or the **Component's** constructor function.
959+
Each **Component** can provide the `$canActivate` and `$routerCanDeactivate` **Lifecycle Hooks**. The
960+
`$routerCanDeactivate` hook is an instance method on the **Component**. The `$canActivate` hook is used as a
961+
static method defined on the **Component Definition Object**.
962962

963963
The **Router** will call these hooks to control navigation from one **Route** to another. Each of these hooks can
964964
return a `boolean` or a Promise that will resolve to a `boolean`.
965965

966966
During a navigation, some **Components** will become inactive and some will become active. Before the navigation
967967
can complete, all the **Components** must agree that they can be deactivated or activated, respectively.
968968

969-
The **Router** will call the `$routerCanDeactivate` and `$routerCanActivate` hooks, if they are provided. If any
969+
The **Router** will call the `$routerCanDeactivate` and `$canActivate` hooks, if they are provided. If any
970970
of the hooks resolve to `false` then the navigation is cancelled.
971971

972972
### Dialog Box Service

0 commit comments

Comments
 (0)