Ember.Select中的绑定动作
我想知道如何绑定Ember中的动作。选择só当用户更改类别时我可以执行其他操作:
{{view Ember.Select class="form-control" id="PackCategory" content=Categories optionValuePath="content.categoryId" optionLabelPath="content.name" value=VendingAdminController.selectedPack.categoryId}}
以及如何将视图指定为目标?
谢谢
像主销建议,
只需在控制器中创建一个函数,即观察{{select}}
的value属性
onSelectedPackChange:function(){ //insert the code that needs to be excuted on change here }.observes('selectedPack.categoryId')
上面的代码应该放在你的VendingAdminController
。
我没有足够的代表对前一个答案发表评论,但我认为没有观察到ember语法
onSelectedPackChange:function(){ //insert the code that needs to be excuted on change here }.observes('selectedPack.categoryId')