Class: SC.StatePathMatcher
Extends
SC.Object.
The SC.StatePathMatcher
is used to match a given state path match expression
against state paths. A state path is a basic dot-notion consisting of
one or more state names joined using '.'. Ex: 'foo', 'foo.bar'.
The state path match expression language provides a way of expressing a state path. The expression is matched against a state path from the end of the state path to the beginning of the state path. A match is true if the expression has been satisfied by the given path.
Syntax:
expression ->
path ->
subpath -> '.'
this -> 'this'
part ->
expansion ->
name -> [a-z_][\w]*
Expression examples:
foo
foo.bar
foo.bar.mah
foo~mah
this.foo
this.foo.bar
this.foo~mah
foo.bar~mah
foo~bar.mah
Defined in: state_path_matcher.js
Field Summary
- Fields borrowed from SC.Object:
- concatenatedProperties, isDestroyed, isObject, nextProperty, object, property, target, toInvalidate
- Fields borrowed from SC.Observable:
- isObservable
Instance Methods
Field Detail
expressionThe expression used by this matcher to match against given state paths
The state that is used to represent 'this' for the matcher's given expression.
- See:
- #expression
- See:
- #expression
Instance Method Detail
Returns the last part of the expression. So if the expression is 'foo.bar' or 'foo~bar' then 'bar' is returned in both cases. If the expression is 'this' then 'this is returned.
Will make a state path against this matcher's expression.
The path provided must follow a basic dot-notation path containing one or dots '.'. Ex: 'foo', 'foo.bar'
- Parameters:
- path
- {String} a dot-notation path
- Returns:
- Boolean
- true if there is a match, otherwise false