W3cubDocs

/Angular 12

IsActiveMatchOptions

interface

A set of options which specify how to determine if a UrlTree is active, given the UrlTree for the current router state.

interface IsActiveMatchOptions {
  matrixParams: 'exact' | 'subset' | 'ignored'
  queryParams: 'exact' | 'subset' | 'ignored'
  paths: 'exact' | 'subset'
  fragment: 'exact' | 'ignored'
}

See also

  • Router.isActive

Properties

Property Description
matrixParams: 'exact' | 'subset' | 'ignored'

Defines the strategy for comparing the matrix parameters of two UrlTrees.

The matrix parameter matching is dependent on the strategy for matching the segments. That is, if the paths option is set to 'subset', only the matrix parameters of the matching segments will be compared.

  • 'exact': Requires that matching segments also have exact matrix parameter matches.
  • 'subset': The matching segments in the router's active UrlTree may contain extra matrix parameters, but those that exist in the UrlTree in question must match.
  • 'ignored': When comparing UrlTrees, matrix params will be ignored.
queryParams: 'exact' | 'subset' | 'ignored'

Defines the strategy for comparing the query parameters of two UrlTrees.

  • 'exact': the query parameters must match exactly.
  • 'subset': the active UrlTree may contain extra parameters, but must match the key and value of any that exist in the UrlTree in question.
  • 'ignored': When comparing UrlTrees, query params will be ignored.
paths: 'exact' | 'subset'

Defines the strategy for comparing the UrlSegments of the UrlTrees.

  • 'exact': all segments in each UrlTree must match.
  • 'subset': a UrlTree will be determined to be active if it is a subtree of the active route. That is, the active route may contain extra segments, but must at least have all the segements of the UrlTree in question.
fragment: 'exact' | 'ignored'
  • 'exact': indicates that the UrlTree` fragments must be equal.
  • 'ignored': the fragments will not be compared when determining if a UrlTree is active.

© 2010–2021 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v12.angular.io/api/router/IsActiveMatchOptions