@fileoverview Uses Gulpjs and angular-templatecache to convert html to javascript templates
@author Scott Nath
@requires NPM:angular-templatecache
@requires ./lib/get-options
var angularTemplatecache = require('gulp-angular-templatecache');
var mergeOptions = require('../get-options').mergeOptions;
Function to get default options for an implementation of gulp-angular-templatecache
var getDefaultOptions = function () {
'use strict';
// default options for angularTemplatecache gulp task
var options = {
config: {
module: 'templatescache',
standalone: true
},
src: ['./bower_components/pattern-library/patterns
@param | Type | Description |
---|---|---|
gulp | Object | including file should inject the gulp module |
projectOptions | Object | object of options |
/*.html'],
dest: './scripts',
dependencies: [] // gulp tasks which should be run before this task
};
return options;
};
/**
Gulp task that uses gulp-angular-templatecache to create $templateCache.put javascript templates from app html files
exports.gulpAngularTemplatecache = function (gulp, projectOptions) {
'use strict';
var options = mergeOptions(getDefaultOptions(), projectOptions);
gulp.task('angularTemplatecache', options.dependencies, function () {
return gulp.src(options.src)
.pipe(angularTemplatecache(options.config))
.pipe(gulp.dest(options.dest));
});
};