ng1 | angular-ui-router
Options
Menu

Module ng1

Angular 1 types

UI-Router core provides various Typescript types which you can use for code completion and validating parameter values, etc. The customizations to the core types for Angular UI-Router are documented here.

The optional $resolve service is also documented here.

Index

Variables

id: number = 0
mod_cmpt: any = angular.module('ui.router.compat', ['ui.router'])
mod_init: any = angular.module('ui.router.init', [])
mod_main: any = angular.module('ui.router', ['ui.router.init', 'ui.router.state', 'ui.router.angular1'])
mod_rtr: any = angular.module('ui.router.router', ['ui.router.util'])
mod_state: any = angular.module('ui.router.state', ['ui.router.router', 'ui.router.util', 'ui.router.angular1'])
mod_util: any = angular.module('ui.router.util', ['ng', 'ui.router.init'])
ng_from_global: any = angular
router: UIRouter = null

Functions

  • $uiRouter($locationProvider: ILocationProvider): UIRouter
  • 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 UIRouter


  • getProviderFor(serviceName: any): Array<string | (Anonymous function)>
  • getStateHookBuilder(hookName: "onEnter" | "onExit" | "onRetain"): stateHookBuilder
  • This is a StateBuilder.builder function for angular1 onEnter, onExit, onRetain callback hooks on a Ng1StateDeclaration.

  • getStateProvider(): any
  • hasAnyKey(keys: any, obj: any): any
  • runBlock($injector: IInjectorService, $q: IQService, $uiRouter: UIRouter): void
  • watchDigests($rootScope: IRootScopeService): 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<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.

    Not bundled by default

    This API is no longer not part of the standard angular-ui-router bundle. For users of the prebuilt bundles, add the release/resolveService.min.js UMD bundle. For bundlers (webpack, browserify, etc), add angular-ui-router/lib/legacy/resolveService.


    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.

    Example:

    let invocables = {
      foo: [ '$http', ($http) =>
               $http.get('/api/foo').then(resp => resp.data) ],
      bar: [ 'foo', '$http', (foo, $http) =>
               $http.get('/api/bar/' + foo.barId).then(resp => resp.data) ]
    }
    $resolve.resolve(invocables)
        .then(results => console.log(results.foo, results.bar))
    // Logs foo and bar:
    // { id: 123, barId: 456, fooData: 'foo data' }
    // { id: 456, barData: 'bar data' }
    

    Parameters

    • invocables object
      :

      an object which looks like an StateDeclaration.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<any>


Generated using TypeDoc