Abd*_*ola 0 javascript ember.js
我想从我的把手脚本中向我的控制器发送额外的信息; 这是我的代码:
<a {{action "resetState" data="state1" }}>reset1 </a>
Run Code Online (Sandbox Code Playgroud)
我无法在我的控制器中检索state1; 如何向后端发送额外的字符串?
API表示您可以传递多个参数.
HTML和把手:
{{officename}}
<button {{action "actionTest" "hello" "goodbye" officename}}>See parameters through action in the console</button>
Run Code Online (Sandbox Code Playgroud)
控制器:
actionTest: function(a, b, c){
console.log(a);
console.log(b);
console.log(c);
},
Run Code Online (Sandbox Code Playgroud)