### Full Nested View Hierarchy Example
Source: https://ui-router.github.io/guide/views
Demonstrates the complete rendering of nested components, showing how the `MessageContentComponent` is rendered into the innermost viewport, completing the drill-down UI structure.
```html
INBOX
SPAM
DELETED
SENT
Message 1
Message 2
Message 3
Date: 2017-08-01
Sender: GlobalCorp Bank
Subject: Need a loan?
Hey you! We have the best loans.
You should really get a loan.
Loans are awesome.
```
--------------------------------
### State URL Configuration Examples
Source: https://ui-router.github.io/core/docs/latest/interfaces/_state_interface_.statedeclaration
Provides examples of URL patterns for state configuration, including path parameters, query parameters, and type casting.
```APIDOC
url: string
* The url fragment for the state.
* A URL fragment (with optional parameters) which is used to match the browser location with this state.
* This fragment will be appended to the parent state's URL in order to build up the overall URL for this state.
* See [UrlMatcher](../classes/_url_urlmatcher_.urlmatcher.html) for details on acceptable patterns.
* Examples:
* `/home`
* `/users/:userid`
* `/books/{bookid:[a-zA-Z_-]}`
* `/books/{categoryid:int}`
* `/books/{publishername:string}/{categoryid:int}`
* `/messages?before&after`
* `/messages?{before:date}&{after:date}`
* `/messages/:mailboxid?{before:date}&{after:date}`
```
--------------------------------
### URL Service: Get Path
Source: https://ui-router.github.io/ng1/docs/latest/classes/url.urlservice
Retrieves the path part of the current URL. For example, in `/some/path?query=value#anchor`, this returns `/some/path`.
```APIDOC
path(): string
- Gets the path part of the current url.
- Parameters: None
- Returns: string - The path portion of the url.
```
--------------------------------
### UI-Router onStart Transition Hook Example
Source: https://ui-router.github.io/ng1/docs/latest/classes/transition.transitionservice
Example of using the onStart transition hook to check authentication before entering states that require it. If authentication fails, it redirects to a 'guest' state.
```javascript
// ng1
$transitions.onStart( { to: 'auth.**' }, function(trans) {
var $state = trans.router.stateService;
var MyAuthService = trans.injector().get('MyAuthService');
// If the user is not authenticated
if (!MyAuthService.isAuthenticated()) {
// Then return a promise for a successful login.
// The transition will wait for this promise to settle
return MyAuthService.authenticate().catch(function() {
// If the authenticate() method failed for whatever reason,
// redirect to a 'guest' state which doesn't require auth.
return $state.target("guest");
});
}
});
```
--------------------------------
### UI-Router When Policy: EAGER Example
Source: https://ui-router.github.io/ng1/docs/latest/interfaces/resolve.resolvepolicy
Demonstrates the 'EAGER' when policy for UI-Router resolves. Resolves are fetched as soon as the transition starts, before any states are entered.
```javascript
var mainState = {
name: 'main',
resolve: mainResolves, // defined elsewhere
resolvePolicy: { when: 'EAGER' },
}
var homeState = {
name: 'main.home',
resolve: homeResolves, // defined elsewhere
resolvePolicy: { when: 'EAGER' },
}
```
--------------------------------
### AngularJS Example: Login during Transition
Source: https://ui-router.github.io/react/docs/latest/classes/_uirouter_core_transition_transition.transition
An example demonstrating how to use the `onStart` hook in AngularJS to intercept transitions, handle user authentication asynchronously, and resume or redirect the transition based on the authentication outcome.
```javascript
// ng1
$transitions.onStart( { to: 'auth.**' }, function(trans) {
var $state = trans.router.stateService;
var MyAuthService = trans.injector().get('MyAuthService');
// If the user is not authenticated
if (!MyAuthService.isAuthenticated()) {
// Then return a promise for a successful login.
// The transition will wait for this promise to settle
return MyAuthService.authenticate().catch(function() {
// If the authenticate() method failed for whatever reason,
// redirect to a 'guest' state which doesn't require auth.
return $state.target("guest");
});
}
});
```
--------------------------------
### URL Service: Get Hash
Source: https://ui-router.github.io/ng1/docs/latest/classes/url.urlservice
Retrieves the hash part (anchor) of the current URL. For example, in `/some/path?query=value#anchor`, this returns `anchor`.
```APIDOC
hash(): string
- Gets the hash part of the current url.
- Parameters: None
- Returns: string - The hash (anchor) portion of the url.
```
--------------------------------
### UI-Router onStart Example (Login Intercept)
Source: https://ui-router.github.io/core/docs/latest/classes/_transition_transitionservice_.transitionservice
An AngularJS example demonstrating how to use the onStart hook to intercept transitions to authenticated states. It checks user authentication, prompts for login if necessary, and handles redirection or continuation based on the login outcome.
```ng1
$transitions.onStart( { to: 'auth.**' }, function(trans) {
var $state = trans.router.stateService;
var MyAuthService = trans.injector().get('MyAuthService');
// If the user is not authenticated
if (!MyAuthService.isAuthenticated()) {
// Then return a promise for a successful login.
// The transition will wait for this promise to settle
return MyAuthService.authenticate().catch(function() {
// If the authenticate() method failed for whatever reason,
// redirect to a 'guest' state which doesn't require auth.
return $state.target("guest");
});
}
});
```
--------------------------------
### URL Service: Get Search Parameters
Source: https://ui-router.github.io/ng1/docs/latest/classes/url.urlservice
Retrieves the search (query) part of the current URL as a JavaScript object. For example, in `/some/path?query=value#anchor`, this returns `{ query: 'value' }`.
```APIDOC
search(): object
- Gets the search part of the current url as an object.
- Parameters: None
- Returns: object - The search (query) portion of the url, as an object.
- Example:
```javascript
// If current URL is '/some/path?query=value#anchor'
const queryParams = urlService.search();
// queryParams will be { query: 'value' }
```
```
--------------------------------
### UI-Router Transition Hook Registration API
Source: https://ui-router.github.io/ng1/docs/latest/classes/transition.transitionservice
API documentation for registering transition hooks. Covers methods like onStart and onSuccess, detailing their parameters, return values, and lifecycle.
```APIDOC
TransitionService:
onStart(criteria: HookMatchCriteria, callback: TransitionHookFn, options?: HookRegOptions): Function
- Registers a TransitionHookFn, called before a transition begins.
- The hook can return a promise, a redirect, or throw an error to abort the transition.
- Parameters:
- criteria: HookMatchCriteria - Defines which transitions the hook applies to.
- callback: TransitionHookFn - The function to execute.
- options: HookRegOptions (optional) - Options for hook registration.
- Returns: Function - A function to deregister the hook.
- Defined in ui-router-core/src/transition/transitionService.ts
onSuccess(criteria: HookMatchCriteria, callback: TransitionHookFn, options?: HookRegOptions): Function
- Registers a TransitionHookFn, called after a successful transition completes.
- Hooks are chained off the Transition's promise; invoked when the promise resolves.
- Return value is ignored as the transition is already over.
- Parameters:
- criteria: HookMatchCriteria - Defines which transitions the hook applies to.
- callback: TransitionHookFn - The function to execute.
- options: HookRegOptions (optional) - Options for hook registration.
- Returns: Function - A function to deregister the hook.
- Defined in ui-router-core/src/transition/transitionService.ts
onError(criteria: HookMatchCriteria, callback: TransitionHookFn, options?: HookRegOptions): Function
- Registers a TransitionHookFn, called when a transition fails or is rejected.
- The hook receives the rejection reason.
- Parameters:
- criteria: HookMatchCriteria - Defines which transitions the hook applies to.
- callback: TransitionHookFn - The function to execute.
- options: HookRegOptions (optional) - Options for hook registration.
- Returns: Function - A function to deregister the hook.
onExit(criteria: HookMatchCriteria, callback: TransitionHookFn, options?: HookRegOptions): Function
- Registers a TransitionHookFn, called when a transition exits a state.
- Parameters:
- criteria: HookMatchCriteria - Defines which transitions the hook applies to.
- callback: TransitionHookFn - The function to execute.
- options: HookRegOptions (optional) - Options for hook registration.
- Returns: Function - A function to deregister the hook.
onRetain(criteria: HookMatchCriteria, callback: TransitionHookFn, options?: HookRegOptions): Function
- Registers a TransitionHookFn, called when a transition retains a state.
- Parameters:
- criteria: HookMatchCriteria - Defines which transitions the hook applies to.
- callback: TransitionHookFn - The function to execute.
- options: HookRegOptions (optional) - Options for hook registration.
- Returns: Function - A function to deregister the hook.
onBefore(criteria: HookMatchCriteria, callback: TransitionHookFn, options?: HookRegOptions): Function
- Registers a TransitionHookFn, called before a transition is finalized.
- Parameters:
- criteria: HookMatchCriteria - Defines which transitions the hook applies to.
- callback: TransitionHookFn - The function to execute.
- options: HookRegOptions (optional) - Options for hook registration.
- Returns: Function - A function to deregister the hook.
onFinish(criteria: HookMatchCriteria, callback: TransitionHookFn, options?: HookRegOptions): Function
- Registers a TransitionHookFn, called after a transition has finished.
- Parameters:
- criteria: HookMatchCriteria - Defines which transitions the hook applies to.
- callback: TransitionHookFn - The function to execute.
- options: HookRegOptions (optional) - Options for hook registration.
- Returns: Function - A function to deregister the hook.
HookMatchCriteria:
- An object used to match transitions. Can include properties like 'to', 'from', 'transition', etc.
- Example: { to: 'users.*', from: 'dashboard' }
TransitionHookFn:
- Signature: (transition: Transition) => Promise | any | void
- The function executed by the hook.
- Receives the Transition object as an argument.
HookRegOptions:
- An object for hook registration options.
- Properties: { priority: number, queue: boolean, force: boolean }
Related UI-Router Modules:
- core: Core transition logic and services.
- transition: Detailed transition lifecycle and hook types.
- injectables: Services available within transition hooks.
- state: State management and definition.
- common: Utility functions and predicates.
```
--------------------------------
### UI-Router Angular Development Setup
Source: https://ui-router.github.io/ng2
Steps to clone, install, link, and build UI-Router for Angular and its core dependency from GitHub. This process is for developers contributing to or modifying the UI-Router Angular library.
```bash
mkdir uirouter
cd uirouter
git clone https://github.com/ui-router/angular
git clone https://github.com/ui-router/core
cd core
npm install
npm link
npm run build
cd ../angular
npm install
npm link @uirouter/core
npm run build
```
--------------------------------
### UI-Router StateService API: target and transitionTo
Source: https://ui-router.github.io/core/docs/latest/classes/_state_stateservice_.stateservice
Provides documentation for key methods of the UI-Router StateService, including creating TargetStates and performing low-level state transitions. Details parameters, return values, and usage examples.
```APIDOC
StateService:
target(identifier: StateOrName, params?: RawParams, options?: TransitionOptions): TargetState
- Creates a TargetState.
- This is a factory method for creating a TargetState.
- This may be returned from a Transition Hook to redirect a transition, for example.
- Parameters:
- identifier: StateOrName - The state to target.
- params: RawParams (optional) - A map of parameters for the target state.
- options: TransitionOptions (optional, defaults to {})
- Returns: TargetState - A TargetState object.
transitionTo(to: StateOrName, toParams?: RawParams, options?: TransitionOptions): TransitionPromise
- Low-level method for transitioning to a new state.
- The go() method (which uses transitionTo internally) is recommended in most situations.
- Parameters:
- to: StateOrName - State name or state object.
- toParams: RawParams (optional, defaults to {}) - A map of the parameters that will be sent to the state, will populate $stateParams.
- options: TransitionOptions (optional, defaults to {}) - Transition options.
- Returns: TransitionPromise - A promise representing the state of the new transition. See go().
- Example:
let app = angular.module('app', ['ui.router']);
app.controller('ctrl', function ($scope, $state) {
$scope.changeState = function () {
$state.transitionTo('contact.detail');
};
});
```
--------------------------------
### UI-Router: EAGER Resolve Policy Example
Source: https://ui-router.github.io/core/docs/latest/interfaces/_resolve_interface_.resolvepolicy
Illustrates configuring a state to use the 'EAGER' resolve policy, where resolves are fetched as soon as the transition starts. This happens earlier in the lifecycle than when states are entered.
```javascript
var mainState = {
name: 'main',
resolve: mainResolves, // defined elsewhere
resolvePolicy: { when: 'EAGER' },
}
var homeState = {
name: 'main.home',
resolve: homeResolves, // defined elsewhere
resolvePolicy: { when: 'EAGER' },
}
```
--------------------------------
### JavaScript Example: descriptionOf Function
Source: https://ui-router.github.io/ng1/docs/latest/modules/common_hof
Demonstrates the usage of a hypothetical 'descriptionOf' function with different input types (number and string) to show its output formatting.
```javascript
console.log(descriptionOf(55)); // '(55) That\'s a number!'
console.log(descriptionOf("foo")); // 'Here\'s your string foo'
```
--------------------------------
### Get Object Values
Source: https://ui-router.github.io/core/docs/latest/modules/_common_common_
Retrieves the enumerable property values from a given object. The function takes an object as input and returns an array containing its property values. An example demonstrates its usage.
```TypeScript
/**
* Given an object, return its enumerable property values
* @param obj The object to get values from
* @returns An array of the object's property values
*/
values(obj: Obj): any[]
```
```TypeScript
let foo = { a: 1, b: 2, c: 3 }
let vals = values(foo); // [ 1, 2, 3 ]
```
--------------------------------
### AngularJS TransitionTo Example
Source: https://ui-router.github.io/ng1/docs/latest/classes/state.stateservice
Provides an example of using the transitionTo method in an AngularJS controller to navigate to a different state. This method is a low-level way to manage state transitions.
```javascript
let app = angular.module('app', ['ui.router']);
app.controller('ctrl', function ($scope, $state) {
$scope.changeState = function () {
$state.transitionTo('contact.detail');
};
});
```
--------------------------------
### UI-Router: EAGER Resolve Policy Example
Source: https://ui-router.github.io/react/docs/latest/interfaces/_uirouter_core_resolve_interface.resolvepolicy
Illustrates setting UI-Router states to resolve eagerly at the start of a transition. This fetches all specified resolves as soon as possible during the transition lifecycle, which is earlier than the LAZY approach.
```javascript
var mainState = {
name: 'main',
resolve: mainResolves, // defined elsewhere
resolvePolicy: { when: 'EAGER' },
}
var homeState = {
name: 'main.home',
resolve: homeResolves, // defined elsewhere
resolvePolicy: { when: 'EAGER' },
}
```
--------------------------------
### UI-Router Transition Hook Callback
Source: https://ui-router.github.io/guide/transitionhooks
Example of a basic transition hook callback function that receives the Transition object and accesses its 'to' state. This demonstrates how to access transition details within a hook.
```javascript
function myHook(transition) {
const toState = transition.to();
// ... code
}
```
--------------------------------
### UI-Router Core API Documentation
Source: https://ui-router.github.io/core/docs/latest/modules/_vanilla_baselocationservice_
Comprehensive API documentation for the UI-Router core library, covering various modules and classes. This entry groups related API elements for clarity.
```APIDOC
Module: vanilla/baseLocationService
Classes:
BaseLocationServices
- Represents the base implementation for location services in UI-Router.
Related Classes in Core:
UIRouter
- The main router class.
StateService
- Manages application states.
StateRegistry
- Manages the registration of states.
TransitionService
- Handles state transitions.
UrlService
- Manages URL synchronization.
UrlConfig
- Configuration for URL handling.
UrlRules
- Defines rules for URL matching and generation.
Transition
- Represents a state transition.
Trace
- Utility for tracing UI-Router events.
```
--------------------------------
### UI-Router Transition Methods
Source: https://ui-router.github.io/core/docs/latest/classes/_transition_transition_.transition
Provides documentation for core methods of the UI-Router Transition object, including creating injectors, comparing transitions, and checking active status.
```APIDOC
Transition Methods:
injector(state?: StateOrName, pathName?: string): UIInjector
Creates a UIInjector Dependency Injector for the Transition's target state (to state). The injector provides resolve values which the target state has access to. The UIInjector can also provide values from the native root/global injector (ng1/ng2).
Parameters:
state: Optional. Limits the resolves provided to only the resolves the provided state has access to.
pathName: Optional. Default value 'to'. Chooses the path for which to create the injector. Use this to access resolves for exiting states (e.g., 'from').
Returns: A UIInjector instance.
Examples:
// Get a resolve value from the target state
.onEnter({ entering: 'myState' }, trans => {
var myResolveValue = trans.injector().get('myResolve');
})
// Inject a global service
.onEnter({ entering: 'myState' }, trans => {
var MyService = trans.injector().get('MyService');
})
// Get a promise for a resolve value
.onBefore({}, trans => {
return trans.injector().getAsync('myResolve').then(myResolveValue =>
return myResolveValue !== 'ABORT';
);
})
// Get resolve value from a specific parent state
.onEnter({ to: 'foo.bar' }, trans => {
var fooData = trans.injector('foo').get('myResolve');
})
// Get resolve value from the exiting state
.onExit({ exiting: 'foo.bar' }, trans => {
var fooData = trans.injector(null, 'from').get('myResolve');
})
is(compare: Transition | { from?: any; to?: any }): boolean
Determines whether two transitions are equivalent.
Deprecated.
Parameters:
compare: The transition or state object to compare against.
Returns: boolean
isActive(): boolean
Checks if this transition is currently active/running.
Returns: boolean
```
--------------------------------
### Configure Eager Resolve in UI-Router
Source: https://ui-router.github.io/guide/ng1/migrate-to-1_0
Demonstrates how to configure a resolve to fetch immediately when a transition starts, overriding the default lazy behavior. This is achieved by setting the `when` property to 'EAGER' within the `resolvePolicy` for a specific resolve.
```javascript
$stateProvider.state('foo.bar.baz', {
resolve: {
myEagerResolve: function(MyService) {
return MyService.fetchThings();
}
},
resolvePolicy: {
myEagerResolve: { when: 'EAGER' }
}
});
```
--------------------------------
### Register onEnter Hook with Criteria
Source: https://ui-router.github.io/guide/transitionhooks
This example registers an 'onEnter' hook with a specific criterion, limiting its invocation to transitions where the target state matches 'people'. This demonstrates how to combine state-level hooks with transition criteria for more targeted execution.
```JavaScript
$transitions.onEnter({ entering: 'people' }, function(transition, state) {
console.log('Transition #' + transition.$id + ' Entered ' + state.name);
})
```
--------------------------------
### UI-Router Core Classes and Services
Source: https://ui-router.github.io/core/docs/latest/enums/_params_param_.deftype
Overview of key classes and services available in the UI-Router core library, including State management, Transition handling, and URL configuration.
```APIDOC
Core Components:
Classes:
UIRouter: The main router class.
StateService: Manages application states.
StateRegistry: Registry for all defined states.
TransitionService: Handles state transitions.
UrlService: Manages URL synchronization.
UrlConfig: Configuration for URL handling.
UrlRules: Defines rules for URL matching and generation.
Transition: Represents an ongoing state transition.
Trace: Utility for tracing router events.
Enumerations:
DefType: Defines parameter types (CONFIG, PATH, SEARCH).
```
--------------------------------
### UI-Router TransitionService onSuccess Hook Example
Source: https://ui-router.github.io/guide/transitionhooks
Registers a global transition hook that logs successful transitions to the console. It uses an empty criteria object to match all transitions and accesses the 'from' and 'to' states from the Transition object.
```javascript
$transitions.onSuccess({}, function(transition) {
console.log(
"Successful Transition from " + transition.from().name +
" to " + transition.to().name
);
});
```
--------------------------------
### Registering an onStart Hook (AngularJS)
Source: https://ui-router.github.io/core/docs/latest/classes/_transition_transition_.transition
Example demonstrating how to use the $transitions service to register an onStart hook in AngularJS. This hook intercepts transitions to authenticated states, prompts for login if the user is not authenticated, and handles the authentication promise.
```javascript
$transitions.onStart( { to: 'auth.**' }, function(trans) {
var $state = trans.router.stateService;
var MyAuthService = trans.injector().get('MyAuthService');
// If the user is not authenticated
if (!MyAuthService.isAuthenticated()) {
// Then return a promise for a successful login.
// The transition will wait for this promise to settle
return MyAuthService.authenticate().catch(function() {
// If the authenticate() method failed for whatever reason,
// redirect to a 'guest' state which doesn't require auth.
return $state.target("guest");
});
}
});
```
--------------------------------
### Development Setup for UI-Router AngularJS
Source: https://ui-router.github.io/ng1
Steps to set up the development environment for UI-Router AngularJS, including cloning repositories, installing dependencies, linking packages, and building the project. This process involves UI-Router Core and the AngularJS specific package.
```bash
mkdir uirouter
cd uirouter
git clone https://github.com/angular-ui/ui-router angularjs
git clone https://github.com/ui-router/core core
cd core
npm install
npm link
npm run build
cd ../angularjs
npm install
npm link @uirouter/core
npm run build
```
--------------------------------
### UI-Router Param Class API
Source: https://ui-router.github.io/core/docs/latest/classes/_params_param_.param
Detailed API documentation for the Param class in UI-Router core. This entry covers the class constructor, all its properties with types, and its methods with signatures and return types, providing a complete reference for parameter handling.
```APIDOC
Class: Param
Hierarchy:
* Param
Constructors:
* new Param(id: string, type: ParamType, location: DefType, urlConfig: UrlConfig, state: StateDeclaration): Param
- Parameters:
- id: string
- type: ParamType
- location: DefType
- urlConfig: UrlConfig
- state: StateDeclaration
- Returns: Param
- Defined in src/params/param.ts:140
Properties:
* _defaultValueCache: { defaultValue: any }
- Cache the default value if it is a static value
- Defined in src/params/param.ts:97
* array: boolean
- Defined in src/params/param.ts:94
* config: any
- Defined in src/params/param.ts:95
* dynamic: boolean
- Defined in src/params/param.ts:89
* id: string
- Defined in src/params/param.ts:85
* inherit: boolean
- Defined in src/params/param.ts:93
* isOptional: boolean
- Defined in src/params/param.ts:88
* location: DefType
- Defined in src/params/param.ts:87
* raw: boolean
- Defined in src/params/param.ts:90
* replace: [{ from: any; to: any }]
- Defined in src/params/param.ts:92
* squash: boolean | string
- Defined in src/params/param.ts:91
* type: ParamType
- Defined in src/params/param.ts:86
Methods:
* isDefaultValue(value: any): boolean
- Parameters:
- value: any
- Returns: boolean
- Defined in src/params/param.ts:164
* isSearch(): boolean
- Defined in src/params/param.ts:157
* toString(): string
- Defined in src/params/param.ts:171
* validates(value: any): boolean
- Parameters:
- value: any
- Returns: boolean
- Defined in src/params/param.ts:178
* value(value: any): any
- Parameters:
- value: any
- Returns: any
- Defined in src/params/param.ts:185
* changed(value: any, oldValue: any): boolean
- Parameters:
- value: any
- oldValue: any
- Returns: boolean
- Defined in src/params/param.ts:192
* equals(value: any, oldValue: any): boolean
- Parameters:
- value: any
- oldValue: any
- Returns: boolean
- Defined in src/params/param.ts:199
* validates(value: any): boolean
- Parameters:
- value: any
- Returns: boolean
- Defined in src/params/param.ts:206
* values(value: any): any[]
- Parameters:
- value: any
- Returns: any[]
- Defined in src/params/param.ts:213
```
--------------------------------
### Param Instance Methods
Source: https://ui-router.github.io/core/docs/latest/classes/_params_param_.param
Documentation for instance methods of the Param class, including checking search status, string representation, validation of individual values, and retrieving decoded values.
```APIDOC
isSearch(): boolean
- Checks if the parameter is a search parameter.
- Returns: boolean
tostring(): string
- Returns a string representation of the parameter.
- Returns: string
validates(value: any): boolean
- Validates a given value against the parameter's definition.
- Parameters:
- value: any - The value to validate.
- Returns: boolean
value(value?: any): any
- Gets the decoded representation of a value if the value is defined, otherwise, returns the default value.
- Parameters:
- Optional value: any - The value to decode.
- Returns: any
```
--------------------------------
### UI-Router Lazy Load State Example (JavaScript)
Source: https://ui-router.github.io/guide/lazyloading
Demonstrates using the `lazyLoad` property in a UI-Router state definition to asynchronously load a module (e.g., moment.js) before the state is entered. This improves application performance by deferring resource loading.
```javascript
var mystate = {
name: 'messages',
url: '/messages',
component: messages,
lazyLoad: function() {
return System.import('moment');
}
}
```
--------------------------------
### Get Resolve Tokens - ui-router APIDOC
Source: https://ui-router.github.io/core/docs/latest/classes/_transition_transition_.transition
Retrieves all available resolve tokens (keys) for the transition. This can be used with the injector to inspect resolve values for states in the 'to' path. Includes examples for logging and creating promises for resolve values.
```APIDOC
getResolveTokens(pathname?: string): any[]
- Gets all available resolve tokens (keys)
- This method can be used in conjunction with [injector](_transition_transition_.transition.html#injector) to inspect the resolve values
available to the Transition.
- This returns all the tokens defined on [StateDeclaration.resolve](../interfaces/_state_interface_.statedeclaration.html#resolve) blocks, for the states
in the Transition's [TreeChanges.to](../interfaces/_transition_interface_.treechanges.html#to) path.
[#### Example:](#example)
This example logs all resolve values
```
let tokens = trans.getResolveTokens();
tokens.forEach(token => console.log(token + " = " + trans.injector().get(token)));
```
[#### Example:](#example-1)
This example creates promises for each resolve value.
This triggers fetches of resolves (if any have not yet been fetched).
When all promises have all settled, it logs the resolve values.
```
let tokens = trans.getResolveTokens();
let promise = tokens.map(token => trans.injector().getAsync(token));
Promise.all(promises).then(values => console.log("Resolved values: " + values));
```
Note: Angular 1 users whould use `$q.all()`
#### Parameters
+ ##### Default value pathname: string = "to"
resolve context's path name (e.g., `to` or `from`)
#### Returns any[]
an array of resolve tokens (keys)
```