Defines an AppGuard component.
Guards can prevent activating or deactivating specific pages in our applications.
They can be used for authenticated views where you need to check permissions before the view can enter or leave:
• onCanActivate
Runs before the view can enter. You must resolve(boolean) from custom action to let enter in the page.
• onCanDeactivate
Runs before the view can leave. You must resolve(boolean) from custom action to let leave the page.
You can add an AppGuard component under the App component.
The event
object provided contains informations on current routing attempt:
• pageName
The page name being accessed or leaved.
• route
The active route object with its params
and queryParams
.
• state
The route state with its url
.
Within an AppGuard component, you can add and chain any type of Action component, redirect through RootPage action, finally resolve(boolean) from a CustomAction.
For more information: Route guards
Name | Description |
---|---|
Comment | Describes the object comment to include in the documentation report. This property generally contains an explanation about the object. |
Guard type | Defines the guard type. |
Is active | Defines whether the component is active. |