Cookies concent notice

This site uses cookies from Google to deliver its services and to analyze traffic.
Learn more
Skip to main content
This site is no longer updated.Head to Angular.devHome
/

This is the archived documentation for Angular v17. Please visit angular.dev to see this page for the current version of Angular.

RunGuardsAndResolvers

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

See more...

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

See also

Description

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.