我想知道如何在 Ember.Select 中绑定(bind)一个 Action ,所以当用户更改类别时我可以执行其他操作:
{{view Ember.Select class="form-control" id="PackCategory"
content=Categories
optionValuePath="content.categoryId"
optionLabelPath="content.name"
value=VendingAdminController.selectedPack.categoryId}}
以及如何将 View 指定为目标?
谢谢
最佳答案
就像主销建议的那样,
只需在您的 Controller 中创建一个函数来观察 {{select}}
的值属性
onSelectedPackChange:function(){
//insert the code that needs to be excuted on change here
}.observes('selectedPack.categoryId')
以上代码应放在您的 VendingAdminController
中。
关于javascript - Ember.Select 中的绑定(bind)操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25490556/