Javascript 余烬中的绑定操作。选择

Javascript 余烬中的绑定操作。选择,javascript,jquery,ember.js,handlebars.js,Javascript,Jquery,Ember.js,Handlebars.js,我想知道如何在余烬中绑定操作。当用户更改类别时选择só,我可以执行其他操作: {{view Ember.Select class="form-control" id="PackCategory" content=Categories optionValuePath="content.categoryId" optionLabelPath="content.name" value=VendingAdmi

我想知道如何在余烬中绑定操作。当用户更改类别时选择só,我可以执行其他操作:

{{view Ember.Select class="form-control" id="PackCategory"
            content=Categories
            optionValuePath="content.categoryId"
            optionLabelPath="content.name"
            value=VendingAdminController.selectedPack.categoryId}}
以及如何将视图指定为目标


谢谢你

就像主销建议的那样

只需在控制器中创建一个函数来观察
{{select}

onSelectedPackChange:function(){
  //insert the code that needs to be excuted on change here
}.observes('selectedPack.categoryId')

上面的代码应该放在你的
VendingAdminController

我没有足够的代表对前面的答案发表评论,但我认为余烬语法是不遵守的

onSelectedPackChange:function(){
//在此处插入更改时需要执行的代码

}.observes('selectedPack.categoryId')

您可以遵循此问题中提出的相同模式