Interface StateService<TRouteMap>


@JsType(isNative=true, name="ng.StateService", namespace="<global>") public interface StateService<TRouteMap>
Public AngularTS StateService contract exposed through the global ng namespace for Closure-annotated applications.
  • Method Summary

    Modifier and Type
    Method
    Description
    The current state declaration, when navigation has selected one.
    jsinterop.base.JsPropertyMap<Object>
    The latest successful state parameters.
    getState(Object stateOrName, Object base)
    Return one matching public state declaration.
    elemental2.core.JsArray<StateDeclaration>
    Return every public state declaration.
    <TRouteName>
    Object
    go(TRouteName to, Object... var_args)
    Overload for typed route names and params.
    <TRouteName>
    String
    href(TRouteName stateOrName, Object... var_args)
    Overload for typed route names and params.
    boolean
    matches(Object stateOrName, jsinterop.base.JsPropertyMap<Object> params, Object options)
    Check whether the current state matches a state, ancestor, or glob.
    <TRouteName>
    elemental2.promise.Promise<Void>
    prefetch(TRouteName stateOrName, Object... var_args)
    Prefetch lazy declarations and templates for a typed route.
    void
    The current state declaration, when navigation has selected one.
    void
    setParams(jsinterop.base.JsPropertyMap<Object> params)
    The latest successful state parameters.
    target(Object identifier, jsinterop.base.JsPropertyMap<Object> params, Object options)
    Build a target that can be returned from a transition hook.
  • Method Details

    • getCurrent

      @JsProperty StateDeclaration getCurrent()
      The current state declaration, when navigation has selected one.
    • getParams

      @JsProperty jsinterop.base.JsPropertyMap<Object> getParams()
      The latest successful state parameters.
    • getState

      StateDeclaration getState(Object stateOrName, Object base)
      Return one matching public state declaration.
      Parameters:
      stateOrName - Value supplied for the stateOrName parameter.
      base - Value supplied for the base parameter.
      Returns:
      Method result.
    • getStates

      elemental2.core.JsArray<StateDeclaration> getStates()
      Return every public state declaration.
      Returns:
      Method result.
    • go

      <TRouteName> Object go(TRouteName to, Object... var_args)
      Overload for typed route names and params. Untyped overload used when no route map is supplied.
      Parameters:
      to - Value supplied for the to parameter.
      var_args - Value supplied for the args parameter.
      Returns:
      Method result.
    • href

      <TRouteName> String href(TRouteName stateOrName, Object... var_args)
      Overload for typed route names and params. Untyped overload used when no route map is supplied.
      Parameters:
      stateOrName - Value supplied for the stateOrName parameter.
      var_args - Value supplied for the args parameter.
      Returns:
      Method result.
    • matches

      boolean matches(Object stateOrName, jsinterop.base.JsPropertyMap<Object> params, Object options)
      Check whether the current state matches a state, ancestor, or glob.
      Parameters:
      stateOrName - Value supplied for the stateOrName parameter.
      params - Value supplied for the params parameter.
      options - Value supplied for the options parameter.
      Returns:
      Method result.
    • prefetch

      <TRouteName> elemental2.promise.Promise<Void> prefetch(TRouteName stateOrName, Object... var_args)
      Prefetch lazy declarations and templates for a typed route. Prefetch lazy declarations and templates without navigating.
      Parameters:
      stateOrName - Value supplied for the stateOrName parameter.
      var_args - Value supplied for the args parameter.
      Returns:
      Method result.
    • setCurrent

      @JsProperty void setCurrent(StateDeclaration current)
      The current state declaration, when navigation has selected one.
    • setParams

      @JsProperty void setParams(jsinterop.base.JsPropertyMap<Object> params)
      The latest successful state parameters.
    • target

      Object target(Object identifier, jsinterop.base.JsPropertyMap<Object> params, Object options)
      Build a target that can be returned from a transition hook.
      Parameters:
      identifier - Value supplied for the identifier parameter.
      params - Value supplied for the params parameter.
      options - Value supplied for the options parameter.
      Returns:
      Method result.