ng-templatecache
v0.1.4
Published
Convert angular templates into $templateCache entries
Downloads
145
Maintainers
Readme
ng-templatecache
Convert Angular templates to $templateCache entries.
Installation
npm install --save ng-templatecache
Usage
var templatecache = require('templatecache');
var myTemplate = '<div>Hello, {{firstName}}</div>';
templatecache.render({
entries: [{content: myTemplate, path: '/templates/greet.html'}],
module: 'templates'
});
Results in
angular.module('templates').run(['$templateCache', function($templateCache) {
$templateCache.put('/templates/greet.html', '<div>Hello, {{firstName}}</div>');
}]);
Options
entries
The list of entries to be added to the cache, each containingpath
andcontent
module
(default:"templates"
) sets the generate module name.false
means don't create a moduleprefix
(default:''
) Prefix to add to template pathsstandalone
(default:false
) iftrue
, the module will be created asangular.module('xxx', [])