如何以如下方式获取按钮的操作:
<script type="text/x-handlebars">
{{#view Ember.Button target="Welcome.booksController" action="loadBooks" id="butt_logger"}}
Load Books
{{/view}}
</script>
在 .js 文件中
$(document).ready( function () {
$('button#butt_logger').click(function(){
console.log("Button was Clicked");
});
});
或者
Welcome.booksController = Ember.ArrayController.create({
content: [],
loadBooks: function(){
console.log("Button was Clicked");
//any script
}
});
他们两个都不起作用((我需要建议。谢谢。