Interface Route

Index

Properties

Methods

Properties

public greedy: boolean

If crossroads should try to match this Route even after matching another Route.

public matched: Signal

public rules: any

Object used to configure parameters/segments validation rules.

public switched: Signal

Signal dispatched every time a request "leaves" the route.

Methods

public add(listener: Function, listenerContext?: any, priority?: Number): SignalBinding

Add a listener to the signal.

Parameters

  • listener: Function

    Signal handler function.

  • listenerContext?: any optional
  • priority?: Number optional

    The priority level of the event listener. Listeners with higher priority will be executed before listeners with lower priority. Listeners with same priority level will be executed at the same order as they were added. (default = 0)

Returns

SignalBinding

public dispose(): any

Remove route from crossroads and destroy it, releasing memory.

Returns

any

public interpolate(replacements: any): string

Return a string that matches the route replacing the capturing groups with the values provided in the replacements object.

Parameters

  • replacements: any

Returns

string

public match(request: any): boolean

Test if Route matches against request. Return true if request validate against route rules and pattern.

Parameters

  • request: any

Returns

boolean