【发布时间】:2014-05-20 15:52:07
【问题描述】:
在我的路线中,我正在获取一些产品。
setupController: (controller, model) ->
controller.set('model', model)
controller.set('commissionLines', @store.find('commissionLine'))
controller.set 'products', @store.find('product')
产品显示在我的车把模板中,我使用每个循环打印它们。每个产品的描述,我想隐藏,直到产品被点击。所以我添加了一个视图,它观察控制器中的产品,并相应地添加点击事件。
MyApp.PropperViewNameView = Ember.View.extend
applyClick: ( =>
@$('.button.expand').click (e) =>
@$(@).parent('tr').next().transition('slide down')
).observes('controller.products')
不幸的是没有发生绑定,如果我在应用点击方法中添加“调试器”,我可以看到它在 html 呈现之前被触发。
如何正确附加我的绑定?
【问题讨论】:
标签: ember.js coffeescript