当用户更改我可以执行的其他操作时,我想知道如何在Ember.Select só中绑定一个操作:
{{view Ember.Select class="form-control" id="PackCategory"
content=Categories
optionValuePath="content.categoryId"
optionLabelPath="content.name"
value=VendingAdminController.selectedPack.categoryId}}以及如何将视图指定为目标?
谢谢
发布于 2014-09-15 15:56:14
就像大头针建议的,
只需在控制器中创建一个观察{{select}}值属性的函数即可。
onSelectedPackChange:function(){
//insert the code that needs to be excuted on change here
}.observes('selectedPack.categoryId')上面的代码应该放在您的VendingAdminController中。
发布于 2014-11-19 17:17:21
我没有足够的代表来评论前面的答案,但我认为ember语法是观察而不是观察的
onSelectedPackChange:function(){ //insert the code that needs to be excuted on change here }.observes('selectedPack.categoryId')
https://stackoverflow.com/questions/25490556
复制相似问题