marklagendijk/gulp-ng-html2js — pull request #9 by teemualap (2014-09-10 09:09:01+00:00)
Title: Ability to output `$templateCache.put` -calls only

Hi,

added the ability to strip everything but `$templateCache.put` -calls from the output. This is useful for large applications. Dozens of templates also mean dozens of unnecessary run blocks and unnecessary file size.

This is how I use it now:

```js
var tplPrefix = 'angular.module("templatesModuleName").run(function($templateCache){\n';
var tplSuffix = '\n});';

gulp.src(['src/app/**/*.tpl.html'])
.pipe(jade(jadeConfig))
.pipe(html2js({
externalModule: true
}))
.pipe(concat('templates-file-name.js'))
.pipe(insert.wrap(tplPrefix, tplSuffix))
.pipe(gulp.dest('tmp'));
```

With output like this:
```js
angular.module('templatesModuleName').run(function($templateCache){
$templateCache.put('module/template-name.tpl.html',
'

Hello

');
$templateCache.put('other-module/template-name.tpl.html',
'

World

');
//... etc
});
```

I left annotations out of this example because of [gulp-ng-annotate](https://github.com/Kagami/gulp-ng-annotate).