Transitions are defined by creating a module like
app/transitions/my-transition.js
that exports a
function. The function must return a Promise that resolves when the
transition is done.
The function has access to the current transition context via
this
. The context includes:
oldElement
newElement
oldValue, newValue
<LiquidBind />
).oldView, newView
older
{ element, value, view }
. lookup
this.lookup('other').apply(this).then(...)
.Your transition can receive arguments directly from use
statements in transition rules. For example:
/* app/transitions/my-animation.js */
export default function (/* color , opts */) {
//...
}
/* within app/transitions.js */
this.transition(
this.toRoute('home'),
this.use('myAnimation', 'red', { duration: 100 }),
);
Note: if your custom transition is not being found, restart your ember server ...