#

API Docs for: v2.11.1
Show: Inherited Protected Private Deprecated

# Transition Class

Defined in: `node_modules/router_js/lib/router/transition.js:5`
Module: ember

A Transition is a thennable (a promise-like object) that represents an attempt to transition to another route. It can be aborted, either explicitly via `abort` or by attempting another transition while a previous one is still underway. An aborted transition can also be `retry()`d later.

## Constructor

### `Transition`

(

- `router`
- `intent`
- `state`
- `error`

)
private

Defined in `node_modules/router_js/lib/router/transition.js:5`

#### Parameters:

- `router` Object
- `intent` Object
- `state` Object
- `error` Object

- Index
- Methods
- Properties

## Item Index

### Methods

- abort
- catch
- finally
- followRedirects
- method
- retry
- then
- trigger

### Properties

- data
- promise

## Methods

### `abort`

() Transition public

Defined in `node_modules/router_js/lib/router/transition.js:206`

Aborts the Transition. Note you can also implicitly abort a transition by initiating another transition while a previous one is underway.

#### Returns:

Transition:

this transition

### `catch`

(

- `onRejection`
- `label`

)
Promise public

Defined in `node_modules/router_js/lib/router/transition.js:172`

Forwards to the internal `promise` property which you can use in situations where you want to pass around a thennable, but not the Transition itself.

#### Parameters:

- `onRejection` Function
- `label` String

  optional string for labeling the promise. Useful for tooling.

#### Returns:

Promise:

### `finally`

(

- `callback`
- `label`

)
Promise public

Defined in `node_modules/router_js/lib/router/transition.js:189`

Forwards to the internal `promise` property which you can use in situations where you want to pass around a thennable, but not the Transition itself.

#### Parameters:

- `callback` Function
- `label` String

  optional string for labeling the promise. Useful for tooling.

#### Returns:

Promise:

### `followRedirects`

() Promise public

Defined in `node_modules/router_js/lib/router/transition.js:289`

Transitions are aborted and their promises rejected when redirects occur; this method returns a promise that will follow any redirects that occur and fulfill with the value fulfilled by any redirecting transitions that occur.

#### Returns:

Promise:

a promise that fulfills with the same value that the final redirecting transition fulfills with

### `method`

(

- `method`

)
Transition public

Defined in `node_modules/router_js/lib/router/transition.js:240`

Sets the URL-changing method to be employed at the end of a successful transition. By default, a new Transition will just use `updateURL`, but passing 'replace' to this method will cause the URL to update using 'replaceWith' instead. Omitting a parameter will disable the URL change, allowing for transitions that don't update the URL at completion (this is also used for handleURL, since the URL has already changed before the transition took place).

#### Parameters:

- `method` String

  the type of URL-changing method to use at the end of a transition. Accepted values are 'replace', falsy values, or any other non-falsy value (which is interpreted as an updateURL transition).

#### Returns:

Transition:

this transition

### `retry`

() Transition public

Defined in `node_modules/router_js/lib/router/transition.js:224`

Retries a previously-aborted transition (making sure to abort the transition if it's still active). Returns a new transition that represents the new attempt to transition.

#### Returns:

Transition:

new transition

### `then`

(

- `onFulfilled`
- `onRejected`
- `label`

)
Promise public

Defined in `node_modules/router_js/lib/router/transition.js:152`

A standard promise hook that resolves if the transition succeeds and rejects if it fails/redirects/aborts.

Forwards to the internal `promise` property which you can use in situations where you want to pass around a thennable, but not the Transition itself.

#### Parameters:

- `onFulfilled` Function
- `onRejected` Function
- `label` String

  optional string for labeling the promise. Useful for tooling.

#### Returns:

Promise:

### `trigger`

(

- `[ignoreFailure=false]`
- `name`

)
public

Defined in `node_modules/router_js/lib/router/transition.js:265`

Fires an event on the current list of resolved/resolving handlers within this transition. Useful for firing events on route hierarchies that haven't fully been entered yet. Note: This method is also aliased as `send`

#### Parameters:

- `[ignoreFailure=false]` Boolean optional

  a boolean specifying whether unhandled events throw an error

- `name` String

  the name of the event to fire

## Properties

### `data`

Object public

Defined in `node_modules/router_js/lib/router/transition.js:139`

Custom state can be stored on a Transition's `data` object. This can be useful for decorating a Transition within an earlier hook and shared with a later hook. Properties set on `data` will be copied to new transitions generated by calling `retry` on this transition.

### `promise`

Object public

Defined in `node_modules/router_js/lib/router/transition.js:125`

The Transition's internal promise. Calling `.then` on this property is that same as calling `.then` on the Transition object itself, but this property is exposed for when you want to pass around a Transition's promise, but not the Transition object itself, since Transition object can be externally `abort`ed, while the promise cannot.