Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

44 lines (28 sloc) 1.481 kB

Warning

I've stopped using ember and am no longer maintaining this repository. Support for this project will continue to be provided by bartsqueezy within the new ember-handlebars-brunch repo.

Ember Handlebars for Brunch

This plugin adds Ember Handlebars template pre-compiling to brunch, utilizing the latest and greatest EmberJS build (compatible with the new ember v3 router).

Usage

Add "ember-handlebars-brunch": "git+ssh://git@github.com:icholy/ember-handlebars-brunch.git". to package.json of your brunch app.

set the templates compiler in config.coffee set precompile to true if you want to enable it

templates:
  precompile: true  # default is false
  root: 'templates/'
  defaultExtension: 'hbs'
  joinTo: 'javascripts/app.js' : /^app/

place your handlebars templates in the app/templates/ directory and give them a .hbs extension

app/
  templates/
  application.hbs
    my_template.hbs
  subdir/
    another_template.hbs

the template name will be the path without the root

App.MyView = Ember.View.extend({
    templateName: 'my_template'
});

Also accessible through Ember.TEMPLATES

var anotherTemplate = Ember.TEMPLATES['subdir/another_template'];

If you wish to require the template, you have to use the full path

require('templates/application');
Jump to Line
Something went wrong with that request. Please try again.