Use npm as a build tool to load all your jade/html templates into your $templateCache.
$ npm-html2js -i 'src/**/*.jade' -o 'dist/template.js'angular; ;
Install
Via npm:
npm install --save-dev npm-html2js
And load it in your build process in your package.json
:
"scripts": ,
Options
Input
Path to your templates. The module supports globbing so you can use path like src/**/*.tpl.html
example:
npm-html2js -i 'files/**/*.tpl.html'
output
Path to the expected output file.
example:
npm-html2js ... -o 'dist/template.js'
module
The name of the parent Angular module for each set of templates. Defaults to the task target prefixed by templates.js
example:
npm-html2js ... -m 'myModule'
jade
if the filename ends with .jade
, the task will automatically render file's content using Jade then comile into JS
base
The prefix relative to the project directory that should be stripped from each template path to produce a module identifier for the template. For example, a template located at src/projects/projects.tpl.html
would be identified as just projects/projects.tpl.html
.
example:
npm-html2js ... -b 'src'
help
Display the command line options