ng-html2js icon indicating copy to clipboard operation
ng-html2js copied to clipboard

can I use it like require(ng-html2js)

Open ajsan opened this issue 10 years ago • 1 comments

RT

ajsan avatar Aug 05 '15 03:08 ajsan

Yes, here's how:

Ask the question on stack overflow.

JK.. here's really how:

var ngHtml2js = require('ng-html2js'), 
    fs = require('fs');

var filename = 'path/to/your.html';

var templateHtmlContents = fs.readFileSync(filename, 'utf8');
var templateJsCode = ngHtml2js(filename, templateHtmlContents);

var templateJsFile = 'your/template.js';
fs.writeFileSync(templateJsFile, templateJsCode);

Checkout src/ng-html2js.js file.

I suggest closing this issue too.

jrharshath avatar Jul 30 '16 00:07 jrharshath