Last Updated: February 25, 2016
·
784
· mgrassotti

Ember.TextField [DRAFT]

What I learned by reading tests for Ember.TextField

You can have enter key automatically call an action on the controller (or bubble to route)
https://github.com/emberjs/ember.js/blob/master/packages/ember-handlebars/tests/controls/text_field_test.js#L355

App.PostsController = Ember.ArrayController.extend({
search: function(query, view) {
//do the search
}
})

App.SearchField = Ember.TextField.extend({
action: "search"
})

//in posts.hbs
{{view App.SearchField}}