gulp-ng-template-html
Precompile AngularJS templates to a JS file(angular load function compile it, so that can add it into $templateCache.) and html file(all is dom element)
this repo is branch of gulp-ng-template(some codes are come from gulp-ng-template), if you want to use gulp ng-template, please move to gulp-ng-template.
Thanks Teambition for contribute gulp-ng-template!
Difference
gulp-ng-template-html
compile your html file into 2 file, one is js,one is html. js will provide a loadedTemplateUrl function for load your template, after load done will automate compile it into $templateCache.
gulp-ng-template
Precompile AngularJS templates to a JS file with $templateCache. It put all the html into js.
Install
Install with npm
npm install --save-dev gulp-ng-template-html
Usage
var minifyHtml = ;var ngTemplate = ; gulp;
Demo
test/a.html:
A
test/b.html:
B
gulp test
:
gulp;
test/js/templates.js:
;{ 'use strict'; var appConfig = angular; appConfig; appConfig; }angular;
test/js/templates.html:
<script type="text/ng-template" id="a.html"> <div class="test">A</div> </script> <script type="text/ng-template" id="b.html"> <div class="test"> <span>B</span></div> </script>
Options
moduleName
Optional, Type: String
, Default: 'ngTemplates'
.
Name of the AngularJS module.
standalone
Optional, Type: Boolean
, Default: false
.
Create an AngularJS module.
License
MIT