A basic angular1-like injector api
This object implements four methods similar to the angular 1 dependency injector
UI-Router evolved from an angular 1 library to a framework agnostic library.
However, some of the ui-router-core
code uses these ng1 style APIs to support ng1 style dependency injection.
This object provides a naive implementation of a globally scoped dependency injection system. It supports the following DI approaches:
A function's .toString()
is called, and the parameter names are parsed.
This only works when the parameter names aren't "mangled" by a minifier such as UglifyJS.
function injectedFunction(FooService, BarService) {
// FooService and BarService are injected
}
A function may be annotated with an array of dependency names as the $inject
property.
injectedFunction.$inject = [ 'FooService', 'BarService' ];
function injectedFunction(fs, bs) {
// FooService and BarService are injected as fs and bs parameters
}
An array provides the names of the dependencies to inject (as strings). The function is the last element of the array.
[ 'FooService', 'BarService', function (fs, bs) {
// FooService and BarService are injected as fs and bs parameters
}]
An angular1-like promise api
This object implements four methods similar to the angular 1 promise api
UI-Router evolved from an angular 1 library to a framework agnostic library.
However, some of the ui-router-core
code uses these ng1 style APIs to support ng1 style dependency injection.
This API provides native ES6 promise support wrapped as a $q-like API.
Internally, UI-Router uses this $q object to perform promise operations.
The angular-ui-router
(ui-router for angular 1) uses the $q API provided by angular.
$q-like promise api
A UIRouterPlugin
uses the browser hash to get/set the current location
A UIRouterPlugin
that gets/sets the current location from an in-memory object
A UIRouterPlugin
that gets/sets the current location using the browser's location
and history
apis
Generated using TypeDoc