IMatchCriteria | UI-Router
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IMatchCriteria

This object is used to configure whether or not a Transition Hook is invoked for a particular transition, based on the Transition's "to state" and "from state".

Each property (to, from, exiting, retained, and entering) can be state globs, a function that takes a state, or a boolean (see MatchCriterion)

All properties are optional. If any property is omitted, it is replaced with the value true, and always matches.

example

// This matches a transition coming from the `parent` state and going to the `parent.child` state.
var match = {
  to: 'parent',
  from: 'parent.child'
}
example

// This matches a transition coming from any substate of `parent` and going directly to the `parent` state.
var match = {
  to: 'parent',
  from: 'parent.**'
}
example

// This matches a transition coming from any state and going to any substate of `mymodule`
var match = {
  to: 'mymodule.**'
}
example

// This matches a transition coming from any state and going to any state that has `data.authRequired`
// set to a truthy value.
var match = {
  to: function(state) {
    return state.data != null && state.data.authRequired === true;
  }
}
example

// This matches a transition that is exiting `parent.child`
var match = {
  exiting: 'parent.child'
}

Hierarchy

  • IMatchCriteria

Index

Properties

entering: MatchCriterion

A MatchCriterion to match any state that would be entering

A MatchCriterion to match any state that would be entering

exiting: MatchCriterion

A MatchCriterion to match any state that would be exiting

A MatchCriterion to match any state that would be exiting

from: MatchCriterion

A MatchCriterion to match the original (from) state

A MatchCriterion to match the original (from) state

retained: MatchCriterion

A MatchCriterion to match any state that would be retained

A MatchCriterion to match any state that would be retained

to: MatchCriterion

A MatchCriterion to match the destination state

A MatchCriterion to match the destination state

Generated using TypeDoc