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


  • $stateParamsFactory(ng1UIRouter: any): any
  • annotateController(controllerExpression: any): 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: any

    Returns string[]


  • getBindings(def: any): any
  • getComponentInputs($injector: any, name: any): any
  • ng1UIRouter($locationProvider: any): 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: any

    Returns void


  • runBlock($injector: any, $q: any): void
  • scopeBindings(bindingsObj: any): Array<object>
  • watchDigests($rootScope: any): 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: any, locals?: object, parent?: any): any
  • 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: any
      :

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

    • locals Default value: object = {}
      :

      key/value pre-resolved data (locals)

    • parent Optional: any
      :

      a promise for a "parent resolve"

    Returns any


Generated using TypeDoc