我对Ember很新,但这个看起来很奇怪.
我在模板上有一个div看起来像这样:
<div {{action "selectItem" item target="controllers.items"}}> Hello there! </div>
在我的控制器上,我有一个简单的动作回调:
WebComponent.ItemController = Ember.ArrayController.extend(Ember.Evented, {
needs: ["settings"],
actions: {
selectItem: function (item) {
//This here won't fire unless I attach it to a <button> not a <div>
},
refreshList: function () {
//blah
},
...
}
},
Run Code Online (Sandbox Code Playgroud)
......} ......
在完整的披露中,我正在使用模拟器在Phonegap中工作.有任何想法甚至指示在哪里进行这项调查?