Skip to content

Instantly share code, notes, and snippets.

@jasonblanchard
Last active August 29, 2015 14:00
Show Gist options
  • Select an option

  • Save jasonblanchard/545da09e83037162c3d4 to your computer and use it in GitHub Desktop.

Select an option

Save jasonblanchard/545da09e83037162c3d4 to your computer and use it in GitHub Desktop.
Apprennet.Views.MyThingView = Backbone.View.extend({
// This will initialize backbone/templates/sub_dir/my_thing.hbs into a template function
template: HandlebarsTemplates['backbone/templates/sub_dir/my_thing'],
render: function() {
// Call the template function here with an object that declares the template vars.
this.$el.html(template({name: "My Thing Name"}));
// So here, when compiled, the template will replace {{name}} with "My Thing Name".
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment