I’ve been trying (unsuccessfully) to use Em.Button to trigger an action on my controller but it doesn’t seem to fire the target function. Is there something wrong with the way I’m doing this? The button renders perfectly fine and no errors are being thrown in the console. I’m using the 0.9.3 tagged release from github.
<script type='text/x-handlebars'>
{{#view Em.Button target="App.Controllers.Cards" action="reveal"}}
Reveal
{{/view}}
App.Controllers.Cards = Em.ArrayProxy.create({
content: [],
reveal: function() {
console.log('blah');
}
});
Hmm, your code seems to work fine… http://jsfiddle.net/pangratz666/vCMyD/
Handlebars:
JavaScript: