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

External module ng1

UI-Router for Angular 1

  • Provides an implementation for the CoreServices API, based on angular 1 services.
  • Also registers some services with the angular 1 injector.
  • Creates and bootstraps a new UIRouter object. Ties it to the the angular 1 lifecycle.

Index

Variables

$state: StateService

An injectable service used to query for current state information.

An injectable service used to query for current state information.

This angular service exposes the StateService singleton.

$stateParams: StateParams

An injectable service object which has the current state parameters

An injectable service object which has the current state parameters

This angular service (singleton object) holds the current state parameters. The values in $stateParams are not updated until after a Transition successfully completes.

This object can be injected into other services.

example

SomeService.$inject = ['$http', '$stateParams'];
function SomeService($http, $stateParams) {
  return {
    getUser: function() {
      return $http.get('/api/users/' + $stateParams.username);
    }
  }
};
angular.service('SomeService', SomeService);

Deprecation warning:

When $stateParams is injected into transition hooks, resolves and view controllers, they receive a different object than this global service object. In those cases, the injected object has the parameter values for the pending Transition.

Because of these confusing details, this service is deprecated.

deprecated

Instead of using $stateParams, inject the current <a href="../classes/transition.transition-1.html">Transition</a> as$transition$` and use Transition.params

MyController.$inject = ['$transition$'];
function MyController($transition$) {
  var username = $transition$.params().username;
  // .. do something with username
}
$stateProvider: StateProvider

A config-time injectable provider used to register states.

A config-time injectable provider used to register states.

This angular service exposes the StateProvider singleton.

$transitions: TransitionService

An injectable service primarily used to register transition hooks

An injectable service primarily used to register transition hooks

This angular service exposes the TransitionService singleton, which is primarily used to add transition hooks.

The same object is also exposed as $transitionsProvider for injection during angular config time.

$transitionsProvider: TransitionService

A config-time injectable provider primarily used to register transition hooks

A config-time injectable provider primarily used to register transition hooks

This angular provider exposes the TransitionService singleton, which is primarily used to add transition hooks.

The same object is also exposed as $transitions for injection at runtime.

$urlMatcherFactory: UrlMatcherFactory

An injectable service used to configure the URL.

An injectable service used to configure the URL.

This service is used to set url mapping options, and create UrlMatcher objects.

This angular service exposes the UrlMatcherFactory singleton. The singleton is also exposed at config-time as the $urlMatcherFactoryProvider.

$urlMatcherFactoryProvider: UrlMatcherFactory

An injectable service used to configure the URL.

An injectable service used to configure the URL.

This service is used to set url mapping options, and create UrlMatcher objects.

This angular service exposes the UrlMatcherFactory singleton at config-time. The singleton is also exposed at runtime as the $urlMatcherFactory.

$urlRouter: UrlRouter

An injectable service used to configure URL redirects.

An injectable service used to configure URL redirects.

This angular service exposes the UrlRouter singleton.

$urlRouterProvider: UrlRouterProvider

A config-time injectable provider used to manage the URL.

A config-time injectable provider used to manage the URL.

This angular service exposes the UrlRouterProvider singleton.

id: number
router: UIRouter

Functions

  • $ViewScrollProvider(): void
  • ngdoc

    object

    name

    ui.router.state.$uiViewScrollProvider

    description

    Provider that returns the {@link ui.router.state.$uiViewScroll} service function.

    Returns void


  • $uiRouter($locationProvider: ILocationProvider): void
  • This angular 1 provider instantiates a Router and exposes its services via the angular injector

  • This angular 1 provider instantiates a Router and exposes its services via the angular injector

    Parameters

    • $locationProvider: ILocationProvider

    Returns void


  • annotateController(controllerExpression: Function | Array<any> | string): string[]
  • Annotates a controller expression (may be a controller function(), a "controllername", or "controllername as name")

  • Annotates a controller expression (may be a controller function(), a "controllername", or "controllername as name")

    • Temporarily decorates $injector.instantiate.
    • Invokes $controller() service
      • Calls $injector.instantiate with controller constructor
    • Annotate constructor
    • Undecorate $injector

    returns an array of strings, which are the arguments of the controller expression

    Parameters

    • controllerExpression: Function | Array<any> | string

    Returns string[]


  • getBindings(def: any): any
  • getComponentInputs($injector: IInjectorService, name: string): any
  • getStateHookBuilder(hookName: "onEnter" | "onExit" | "onRetain"): stateHookBuilder
  • This is a StateBuilder.builder function for angular1 onEnter, onExit, onRetain callback hooks on a Ng1StateDeclaration.

  • runBlock($injector: IInjectorService, $q: IQService): void
  • Parameters

    • $injector: IInjectorService
    • $q: IQService

    Returns void


  • watchDigests($rootScope: IScope): void

Object literals

$resolve: object

Implementation of the legacy $resolve service for angular 1.

Implementation of the legacy $resolve service for angular 1.

  • resolve(invocables: object, locals?: object, parent?: Promise<any>): Promise<Obj>
  • Asynchronously injects a resolve block.

  • Asynchronously injects a resolve block.

    This emulates most of the behavior of the ui-router 0.2.x $resolve.resolve() service API.

    Given an object invocables, where keys are strings and values are injectable functions, injects each function, and waits for the resulting promise to resolve. When all resulting promises are resolved, returns the results as an object.

    Parameters

    • invocables: object
      :

      an object which looks like an [[StateDefinition.resolve]] object; keys are resolve names and values are injectable functions

      • [key: string]: Function
    • locals Default value: object = {}
      :

      key/value pre-resolved data (locals)

    • parent Optional: Promise<any>
      :

      a promise for a "parent resolve"

    Returns Promise<Obj>


Generated using TypeDoc