RouteGuard #

Runs before a navigation commits. Returning false cancels it; returning nothing (or true) lets it through. There is no redirect: a guard that wants another URL calls router.push() itself.

TypeScript
type RouteGuard = (to: Route, from: Route) => void | boolean | Promise<void | boolean>

Edit this page

Comments