Skip to content

Instantly share code, notes, and snippets.

@koriroys
Created February 6, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koriroys/94fdc5ed79174f0b1b3f to your computer and use it in GitHub Desktop.
Save koriroys/94fdc5ed79174f0b1b3f to your computer and use it in GitHub Desktop.
compiling a template from a controller in ember js
export default Ember.Controller.extend({
setup: function() {
var template = Handlebars.compile("<p>Name: {{userName}}</p>");
var content = template({ userName: this.get('username') });
this.set('model', this.store.createRecord('post', { content: content }));
false;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment