The State Service
The StateService singleton as a Service Object (injectable during runtime).
This service used to manage and query information on registered states. It exposes state related APIs including:
This angular service exposes the StateService singleton.
The current (or pending) State Parameters
An injectable global Service Object which holds the state parameters for the latest SUCCESSFUL transition.
The values are not updated until after a Transition
successfully completes.
Also: an injectable Per-Transition Object object which holds the pending state parameters for the pending Transition
currently running.
The value injected for $stateParams
is different depending on where it is injected.
Transition
.Transition
.Because of these confusing details, this service is deprecated.
$stateParams
service object,inject $uiRouterGlobals and use UIRouterGlobals.params
MyService.$inject = ['$uiRouterGlobals'];
function MyService($uiRouterGlobals) {
return {
paramValues: function () {
return $uiRouterGlobals.params;
}
}
}
$stateParams
object,inject the current Transition
(as $transition$) and use Transition.params
MyController.$inject = ['$transition$'];
function MyController($transition$) {
var username = $transition$.params().username;
// .. do something with username
}
This object can be injected into other services.
SomeService.$inject = ['$http', '$stateParams'];
function SomeService($http, $stateParams) {
return {
getUser: function() {
return $http.get('/api/users/' + $stateParams.username);
}
}
};
angular.service('SomeService', SomeService);
The StateProvider
An angular1-only StateProvider as a Provider Object (injectable during config time).
This angular service exposes the StateProvider singleton.
The StateProvider
is primarily used to register states or add custom state decorators.
It is a passthrough to $stateRegistry and $state.
The State Registry
The StateRegistry singleton as a Service Object (injectable during runtime).
This service is used to register/deregister states. It has state registration related APIs including:
The State Registry
The StateRegistry singleton as a Provider Object (injectable during config time).
This service is used to register/deregister states. It has state registration related APIs including:
Transition debug/tracing
The Trace singleton as a Service Object (injectable during runtime).
Enables or disables Transition tracing which can help to debug issues.
The current Transition object
The current Transition object as a Per-Transition Object (injectable into Resolve, Hooks, Controllers)
This object returns information about the current transition, including:
The Transition Service
The TransitionService singleton as a Service Object (injectable during runtime).
This angular service exposes the TransitionService singleton, which is primarily used to register global transition hooks.
The Transition Service
The TransitionService singleton as a Provider Object (injectable during config phase)
This angular service exposes the TransitionService singleton, which is primarily used to register global transition hooks.
The UI-Router instance
The UIRouter singleton (the router instance) as a Service Object (injectable during runtime).
This object is the UI-Router singleton instance, created by angular dependency injection during application bootstrap. It has references to the other UI-Router services
Global UI-Router variables
The router global state as a Service Object (injectable during runtime).
This object contains globals such as the current state and current parameter values.
The UI-Router instance
The UIRouter singleton (the router instance) as a Provider Object (injectable during config phase).
This object is the UI-Router singleton instance, created by angular dependency injection during application bootstrap. It has references to the other UI-Router services
The View Scroll function
The View Scroll function as a Service Object (injectable during runtime).
This is a function that scrolls an element into view.
The element is scrolled after a $timeout
so the DOM has time to refresh.
If you prefer to rely on $anchorScroll
to scroll the view to the anchor,
this can be enabled by calling UIViewScrollProvider.useAnchorScroll.
Note: this function is used by the directives.uiView when the autoscroll
expression evaluates to true.
The View Scroll provider
The UIViewScrollProvider as a Provider Object (injectable during config time).
This angular service exposes the UIViewScrollProvider singleton and is used to disable UI-Router's scroll behavior.
The URL Matcher Factory
The UrlMatcherFactory singleton as a Service Object (injectable during runtime).
This service is used to set url mapping options, define custom parameter types, and create UrlMatcher objects.
The URL Matcher Factory
The UrlMatcherFactory singleton as a Provider Object (injectable during config time).
This service is used to set url mapping options, define custom parameter types, and create UrlMatcher objects.
The Url Router
The UrlRouter singleton as a Service Object (injectable during runtime).
The URL Router Provider
The UrlRouter singleton as a Provider Object (injectable during config time).
The URL Service
The UrlService singleton as a Service Object (injectable during runtime).
Note: This service can also be injected during the config phase as $urlServiceProvider.
Used to configure the URL. It has URL related APIs including:
UrlService.config.type
(UrlConfigApi.type)UrlService.rules.when
(UrlRulesApi.when)UrlService.rules.otherwise
(UrlRulesApi.otherwise)The URL Service Provider
The UrlService singleton as a Provider Object (injectable during the angular config phase).
A service used to configure and interact with the URL. It has URL related APIs including:
UrlService.config.type
(UrlConfigApi.type)UrlService.rules.when
(UrlRulesApi.when)UrlService.rules.otherwise
(UrlRulesApi.otherwise)Generated using TypeDoc
Angular 1 injectable services
This is a list of the objects which can be injected using angular's injector.
There are three different kind of injectable objects:
Provider objects
injectable into a
.config()
block during configtime$urlServiceProvider: All URL related public APIs
$uiViewScrollProvider: Disable ui-router view scrolling
Service objects
injectable globally during runtime
$uiViewScroll: Scroll an element into view
$stateParams: (deprecated) Global state param values
Per-Transition objects
Different instances are injected based on the Transition