WAT?
ng-html-to-js converts angular templates into JavaScript call to $templateCache.put(path, content)
,
avoiding roundtrips to the server.
I wanted an alternative for grunt-angular-templates without depending on grunt. Seemed feasible...
TODO
- Minify html without breaking changes
Usage (cli)
ng-html-to-js -s src -d bundle.js
-s
source dir to look for templates (default issrc
)-d
destination script path (overrides any content, default tobundle.js
)-f
file regular expression (defaults to/\.html$/
)-m
function returning the modName, given param p which is the file path (default isreturn "app"
)-t
template root path (defaults to/
)-v
verbose (boolean, default is false)
Usage (programmatic)
var ngHtmlToJs = ; // the values below are the defaults. if they're fine you can omit them. ;