How can I get Ember to start the controller action when the user presses the start key in the input field?
Given the following application code:
App = Ember.Application.create(); App.IndexRoute = Ember.Route.extend({ model: function () { return {foo: "bar"}; } }); App.IndexController = Ember.ObjectController.extend({ actions: { done: function () { console.log("done"); }, cancel: function () { console.log("cancel"); } } });
And the following HTML:
<body> <script type="text/x-handlebars" data-template-name="application"> {{outlet}} </script> <script type="text/x-handlebars" data-template-name="index"> {{input value=foo action="done" cancel="cancel"}} </script> </body>
I expect the cancel action in the controller to be triggered, but I get an error: Property 'cancel' of object [object Object] is not a function .
Here's a JSBin with the code above to illustrate. How can I do this job?
source share