You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Guards are methods that are run before the page navigation takes place and
that can stop the navigation from displaying a certain page.
Use the property guard: someMethod do apply the guard. The method
takes three parameters: page, route and callback. If the callback is called
the navigation takes place - otherwise it is stopped.
<div data-bind="page: {id: 'admin', guard: isLoggedIn}">
This page is only accessible if the user is logged in.
</div>
Use cases are login, validating steps in state machines, etc.
The reason the guard takes a callback as third argument is simply because the guard might be async - accessing
a webserver for login details or asking if a valid shopping card exists etc.
The text was updated successfully, but these errors were encountered:
Guards are methods that are run before the page navigation takes place and
that can stop the navigation from displaying a certain page.
Use the property
guard: someMethod
do apply the guard. The methodtakes three parameters: page, route and callback. If the callback is called
the navigation takes place - otherwise it is stopped.
where
Use cases are login, validating steps in state machines, etc.
The reason the guard takes a callback as third argument is simply because the guard might be async - accessing
a webserver for login details or asking if a valid shopping card exists etc.
The text was updated successfully, but these errors were encountered: