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}}
Written by Michael Grassotti
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Draft
Authors
electblake
1.72K
mgrassotti
1.158K
Related Tags
#draft
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#