Javascript 如何在liquid fire(ember.js)中以编程/动态方式定义管线过渡?

Javascript 如何在liquid fire(ember.js)中以编程/动态方式定义管线过渡?,javascript,ember.js,routes,Javascript,Ember.js,Routes,如果在一个框/视图内的屏幕上有两个按钮,并且如果用户单击“左”按钮,则框应向左转换,而如果用户单击“右”按钮,则框应向右转换。怎么做 这里提出了一个问题: 基本上我已经可以做的是: this.transition( this.fromRoute('foo'), this.toRoute('bar'), this.use('toLeft', { duration: 500 }), this.reverse('toRight', { duration: 500 })

如果在一个框/视图内的屏幕上有两个按钮,并且如果用户单击“左”按钮,则框应向左转换,而如果用户单击“右”按钮,则框应向右转换。怎么做

这里提出了一个问题:

基本上我已经可以做的是:

 this.transition(
    this.fromRoute('foo'),
    this.toRoute('bar'),
    this.use('toLeft', { duration: 500 }),
    this.reverse('toRight', { duration: 500 })
    );    
 this.transition(
    this.fromRoute('foo'),
    this.toRoute('bar'),
    this.hasClass('move-left'), // if true transition to left (this class is inside of {{link-to }} helper
    this.use('toLeft', { duration: 500 }),
    this.reverse('toRight', { duration: 500 })
    );    

  this.transition(
    this.fromRoute('foo'),
    this.toRoute('bar'),
    this.hasClass('move-right'), // if true transition to right (this class is inside of {{link-to }} helper
    this.use('toRight', { duration: 500 }),
    this.reverse('toLeft', { duration: 500 })
    );    
但我想做的是:

 this.transition(
    this.fromRoute('foo'),
    this.toRoute('bar'),
    this.use('toLeft', { duration: 500 }),
    this.reverse('toRight', { duration: 500 })
    );    
 this.transition(
    this.fromRoute('foo'),
    this.toRoute('bar'),
    this.hasClass('move-left'), // if true transition to left (this class is inside of {{link-to }} helper
    this.use('toLeft', { duration: 500 }),
    this.reverse('toRight', { duration: 500 })
    );    

  this.transition(
    this.fromRoute('foo'),
    this.toRoute('bar'),
    this.hasClass('move-right'), // if true transition to right (this class is inside of {{link-to }} helper
    this.use('toRight', { duration: 500 }),
    this.reverse('toLeft', { duration: 500 })
    );    
或者这个:

 this.transition(
    this.fromRoute('foo'),
    this.toRoute('bar'),
    this.toModel(function(){ return this.get('q41') === 'left' })
    this.use('toLeft', { duration: 500 }),
    this.reverse('toRight', { duration: 500 })
    );    

  this.transition(
    this.fromRoute('foo'),
    this.toRoute('bar'),
    this.toModel(function(){ return this.get('q41') === 'right' })
    this.use('toRight', { duration: 500 }),
    this.reverse('toLeft', { duration: 500 })
    );   
是否可以仅在满足某些条件(即已单击特定的{{link to}}辅助对象或已记录模型中的某些数据(正在记录已单击的{{link to}}辅助对象)的情况下,将某些转换/动画应用于Ember中的路线

我遇到的问题是,液体火无法获得模型及其属性