Automatic requires of template calls to helpers, views, controllers and partials.
Write an Ember Handlebars template like so:
templates/index.hbs
templates/login.hbs
Then require the template with your route:
require(["ehbs!index"], function() {
// templates/index.hbs now exists in Ember.TEMPLATES.index
// and
// templates/login.hbs now exists in Ember.TEMPLATES.login
});You can configure the paths for the plugin to look up resources, like so:
require.config({
ehbs: {
paths: {
templates: "foo/bar/templates",
views: "foo/bar/views",
controllers: "foo/bar/controllers",
helpers: "foo/bar/helpers"
}
}
})You can also configure the type of casing used on your files, like so:
require.config({
ehbs: {
casing: "camel"
}
})Valid options are:
camel-require("ehbs!coolTemplate")will loadtemplates/coolTemplate.hbsclass-require("ehbs!coolTemplate")will loadtemplates/CoolTemplate.hbsunderscoreorsnake-require("ehbs!coolTemplate")will loadtemplates/cool_template.hbs
Open up tests/index.html in your browser.
- Builds
- i18n
- More robust and deeper testing
- Pull out ES5 functions for IE6-8 support.
MIT