Overview
An instance of UI-Router. This object contains references to service APIs which define your application’s routing behavior.Properties
trace
Enable/disable tracing to the javascript console for debugging purposes.
viewService
Provides services related to ui-view synchronization
globals
An object that contains global router state, such as the current state and params
transitionService
A service that exposes global Transition Hooks
urlService
Provides services related to the URL
stateRegistry
Provides a registry for states, and related registration services
stateService
Provides services related to states
locationService
Handles low level URL read/write operations
locationConfig
Returns low level URL configuration and metadata
Methods
plugin()
Adds a plugin to UI-Router. A plugin can enhance or change UI-Router behavior using any public API.One of:
- A plugin class which implements
UIRouterPlugin - A constructor function for a
UIRouterPluginwhich accepts aUIRouterinstance - A factory function which accepts a
UIRouterinstance and returns aUIRouterPlugininstance
Options to pass to the plugin class/factory
Example: Basic Plugin
Example: Plugin Authoring
A plugin is simply a class (or constructor function) which accepts aUIRouter instance and (optionally) an options object.
getPlugin()
Returns a plugin registered with the givenpluginName, or all registered plugins.
The name of the plugin to get (optional)
Example
disposable()
Registers an object to be notified when the router is disposed.An object with a
dispose(router: UIRouter) methodExample
dispose()
Disposes this router instance. When called, clears resources retained by the router by callingdispose(this) on all registered disposable objects.
Optional: If provided, calls
dispose(this) on that object onlyExample
Constructor
Creates a newUIRouter object.
A LocationServices implementation (defaults to stub)
A LocationConfig implementation (defaults to stub)
Example
Deprecated Properties
urlMatcherFactory
Legacy URL matcher factory
urlRouter
Legacy URL router