[英]Binding Action in 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')
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.