angular-tpl2js

1.0.0 • Public • Published

angular-tpl2js

Build Status NPM Version Dependency Status devDependency Status Coverage Climate

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.

/angular-tpl2js/

    Package Sidebar

    Install

    npm i angular-tpl2js

    Weekly Downloads

    6

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • scniro