I’m trying to get some data out my templates to, let’s say, add an user.
This is what my view object looks like:
Ember.View.create({
template: Ember.Handlebars.compile( UsersIndexTemplate ),
addUser: function() {
var value = $('#my-awesome-input').val();
}
})
In theory I got my value already with jQuery, but is this the preferred way to go?
You should use bindings to bind the values in your template to properties on your view, see an example http://jsfiddle.net/pangratz666/uuvAp/:
Handlebars:
JavaScript: