angular-tpl2js
v1.0.0
Published
Convert Angular templates to inline JavaScript
Downloads
11
Readme
angular-tpl2js
Inject AngularJS directive templates as inline JavaScript
Install
npm install angular-tpl2js --save-dev
API
inline(path, [config], callback)
let tpl2js = require('angular-tpl2js');
tpl2js.inline('/js/directive.js', function (err, result) {
// directive.js with inline template
});
config
include
for retrieving ng-include templates and HTMLMinifier
, a relay for html-minifier options
// defaults
let config = {
include: false,
HTMLMinifier: {
collapseWhitespace: true,
removeComments: true
}
}
tpl2js.inline('/js/directive.js', {include: true}, function (err, result) {
// directive.js with inline template: ng-include parsed
});
Usage With Gulp
Please use the gulp-angular-tpl2js plugin for use with gulp.