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.
A Transition is not user-constructible; the only legal way to get one is in
a Route hook or a RouterService.on() callback. However, you can import the
type by using import type syntax with TypeScript or import() in JSDoc
comments.
Methods
abort : Transition public
Defined in packages/@ember/routing/transition.ts:88
- returns
- Transition
this transition
Aborts the Transition. Note you can also implicitly abort a transition
by initiating another transition while a previous one is underway.
catch (onRejection, label) : Promise public
Defined in packages/@ember/routing/transition.ts:64
- onRejection
- Function
- label
- String
optional string for labeling the promise. Useful for tooling.
- returns
- Promise
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.
debugAbortStack :
Defined in packages/@ember/routing/transition.ts:177
- returns
string
In non-production builds, this function will return the stack that this
Transition was aborted within (or undefined if the Transition has not
been aborted yet). In production builds, this function will not be present.
debugCreationStack :
Defined in packages/@ember/routing/transition.ts:168
- returns
string
In non-production builds, this function will return the stack that this
Transition was created within. In production builds, this function will not
be present.
finally (callback, label) : Promise public
Defined in packages/@ember/routing/transition.ts:76
- callback
- Function
- label
- String
optional string for labeling the promise. Useful for tooling.
- returns
- Promise
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.
followRedirects : Promise public
Defined in packages/@ember/routing/transition.ts:157
- returns
- Promise
a promise that fulfills with the same value that the final redirecting transition fulfills with
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.
method (method) : Transition public
Defined in packages/@ember/routing/transition.ts:107
- 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
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).
retry : Transition public
Defined in packages/@ember/routing/transition.ts:97
- returns
- Transition
new transition
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.
then (onFulfilled, onRejected, label) : Promise public
Defined in packages/@ember/routing/transition.ts:48
- onFulfilled
- Function
- onRejected
- Function
- label
- String
optional string for labeling the promise. Useful for tooling.
- returns
- Promise
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.
trigger (ignoreFailure, name) public
Defined in packages/@ember/routing/transition.ts:125
- ignoreFailure
- Boolean
a boolean specifying whether unhandled events throw an error
- name
- String
the name of the event to fire
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
Properties
data public
Defined in packages/@ember/routing/transition.ts:37
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.
debugPreviousTransition
Defined in packages/@ember/routing/transition.ts:186
In non-production builds, this property references the Transition that
this Transition was derived from or undefined if this transition did not
derive from another. In production builds, this property will not be present.
from public
Defined in packages/@ember/routing/transition.ts:148
This property is a RouteInfo object that represents where transition
originated from. It's important to note that a RouteInfo is a linked list
and this property represents the head node of the list. In the case of an
initial render, from will be set to null.
promise public
Defined in packages/@ember/routing/transition.ts:25
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 aborted, while the promise cannot.
to public
Defined in packages/@ember/routing/transition.ts:140
This property is a RouteInfo object that represents where the router is
transitioning to. It's important to note that a RouteInfo is a linked list
and this property represents the leafmost route.