1.1.1 • Published 4 years ago

angular-templatecache-extract v1.1.1

Weekly downloads
128
License
ISC
Repository
github
Last release
4 years ago

angular-templatecache-extract

Extract html from Angular's templateCache statements.

Installation

This package is avalable from npm

npm i angular-templatecache-extract --save

Usage

// your angular code
var myApp = angular.module('myApp', []);
myApp.run(function ($templateCache) {
  $templateCache.put('template1.html', '<div>Test1</div>');
  $templateCache.put('template2.html', '<div>Test2' + '</div>');
});
import angularTemplatecacheExtract from 'angular-templatecache-extract';
import fs from 'fs';

fs.readFile(`${__dirname}/angularapp.js`, file => {
  angularTemplatecacheExtract(file.toString()).then(result => {
    console.log(result);
    // ['<div>Test1</div>', '<div>Test2</div>']
  });
});