I want to run ember.js (version 1.0.0 Final) examples provided on their first page.
They divided each handlebar template in separate file with .hbs exte
I build my templates with Grunt. It creates one template.js file which I load after Ember. This is my own Grunt config on coffescript:
module.exports = (grunt) ->
tmpl_dir = 'app_src/templates'
grunt.initConfig
tmpl_dir: tmpl_dir
ember_handlebars:
options:
processName: (path) ->
re = new RegExp("^#{tmpl_dir}\/(.*)\.hbs$", 'i')
r = path.match(re)
path = r[1]
path = path.replace /\_/g, '-'
console.log '>', path
path
files:
src: '<%= tmpl_dir %>/**/*.hbs'
dest: 'public/js/templates.js'
grunt.loadNpmTasks('grunt-ember-handlebars')