Compile static HTML or Jade files to Angular templates. This plugin scans .html
or .jade
files (except in assets) and returns JavaScript in a format similar to this:
angular.module('app').run(['$templateCache', function($templateCache) {
$templateCache.put('template/header.html', '<div>Title</div>');
}]);
Make sure you have the module (default is app
) defined in your JavaScript before templates are declared. (see config.files.order.before
)
You can change the behavior of this plugin by adding options to config.plugins
. Here is an example with the default options.
files: {...},
...,
plugins: {
angularTemplate: {
moduleName: 'app',
pathToSrc: function(x) { return x },
jadeOptions: {},
ignore: []
}
},
....
The name of an established Angular module. This module will be used to access $templateCache
. The default value is app
.
A function to be able to transform the path of the file. (ex: templates/sample.html
) The default value is a no-op.
Local data that can be injected into Jade templates when compiling. The default value is an empty object.
A function/regex/string or an array of functions/regexs/strings that can be used to define files that do not get compiled. (ex: outdated/old.html
) Default is an empty array. (nothing ignored)
Add "aang-template-brunch": "x.y.z"
to package.json
of your brunch app.
Pick a plugin version that corresponds to your minor (y) brunch version.
If you want to use git version of plugin, add
"aang-template-brunch": "git+ssh://git@github.com:jupl/aang-template-brunch.git"
.