UrlMatcherFactory | @uirouter/angularjs
Options
Menu

Class UrlMatcherFactory

Factory for UrlMatcher instances.

The factory is available to ng1 services as $urlMatcherFactory or ng1 providers as $urlMatcherFactoryProvider.

Hierarchy

  • UrlMatcherFactory

Implements

Index

Constructors

Methods

  • caseInsensitive(value?: boolean): boolean
  • Defines whether URL matching should be case sensitive (the default behavior), or not.

  • Defines whether URL matching should be case sensitive (the default behavior), or not.

    Example:

    // Allow case insensitive url matches
    urlService.config.caseInsensitive(true);
    

    Parameters

    • value: Optional  boolean

    Returns boolean

    :

    the current value of caseInsensitive


  • compile(pattern: string, config?: object): UrlMatcher
  • Creates a UrlMatcher for the specified pattern.

  • defaultSquashPolicy(value?: string | true | false): string | true | false
  • Sets the default behavior when generating or matching URLs with default parameter values.

  • Sets the default behavior when generating or matching URLs with default parameter values.

    Example:

    // Remove default parameter values from the url
    urlService.config.defaultSquashPolicy(true);
    
    • nosquash: When generating an href with a default parameter value, do not squash the parameter value from the URL
    • slash: When generating an href with a default parameter value, squash (remove) the parameter value, and, if the parameter is surrounded by slashes, squash (remove) one slash from the URL
    • any other string, e.g. "~": When generating an href with a default parameter value, squash (remove) the parameter value from the URL and replace it with this string.

    Parameters

    • value: Optional  string | true | false

    Returns string | true | false

    :

    the current value of defaultSquashPolicy


  • dispose(): void
  • isMatcher(object: any): boolean
  • Returns true if the specified object is a UrlMatcher, or false otherwise.

  • Returns true if the specified object is a UrlMatcher, or false otherwise.

         implementing all the same methods.
    

    Parameters

    • object any
      :

      The object to perform the type check against.

    Returns boolean

    :

    true if the object matches the UrlMatcher interface, by


  • strictMode(value?: boolean): boolean
  • Defines whether URLs should match trailing slashes, or not (the default behavior).

  • Defines whether URLs should match trailing slashes, or not (the default behavior).

    Example:

    // Allow optional trailing slashes
    urlService.config.strictMode(false);
    

    Parameters

    • value: Optional  boolean

    Returns boolean

    :

    the current value of strictMode


  • Creates and registers a custom ParamType object

    A ParamType can be used to generate URLs with typed parameters.

       The result of this function should be a <a href="../interfaces/params.paramtypedefinition.html">ParamTypeDefinition</a>.
       The result is merged into the existing `definition`.
       See <a href="params.paramtype.html">ParamType</a> for information on the values accepted.
    
    • if only the name parameter was specified: the currently registered ParamType object, or undefined

    Note: Register custom types before using them in a state definition.

    See ParamTypeDefinition for examples

    Parameters

    Returns any

    :

Object literals

paramFactory: object
  • fromConfig(id: string, type: ParamType, config: any): Param
  • Creates a new Param from a CONFIG block

  • fromPath(id: string, type: ParamType, config: any): Param
  • Creates a new Param from a url PATH

  • fromSearch(id: string, type: ParamType, config: any): Param
  • Creates a new Param from a url SEARCH

Generated using TypeDoc