• Overview
@angular/router

RunGuardsAndResolvers

Type Alias

A policy for when to run guards and resolvers on a route.

API

  
    type RunGuardsAndResolvers = | 'pathParamsChange'  | 'pathParamsOrQueryParamsChange'  | 'paramsChange'  | 'paramsOrQueryParamsChange'  | 'always'  | ((from: ActivatedRouteSnapshot, to: ActivatedRouteSnapshot) => boolean)
  
  

Description

A policy for when to run guards and resolvers on a route.

Guards and/or resolvers will always run when a route is activated or deactivated. When a route is unchanged, the default behavior is the same as paramsChange.

paramsChange : Rerun the guards and resolvers when path or path param changes. This does not include query parameters. This option is the default.

  • always : Run on every execution.
  • pathParamsChange : Rerun guards and resolvers when the path params change. This does not compare matrix or query parameters.
  • paramsOrQueryParamsChange : Run when path, matrix, or query parameters change.
  • pathParamsOrQueryParamsChange : Rerun guards and resolvers when the path params change or query params have changed. This does not include matrix parameters.
Jump to details