grunt-angular-templatesでのbootstrapオプションの出力結果に関するメモ
以下のファイルでgruntを実行する。
foo.html
this is foo.
bar.html
this is bar.
Gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({
ngtemplates: {
Test: {
src: '*.html',
dest: 'templates.js',
options: {
bootstrap: function(module, script) {
// module is 'Test'
return "PREFIX\n" + script + "\nSUFFIX";
}
}
}
},
});
grunt.loadNpmTasks('grunt-angular-templates');
grunt.registerTask('default', ["ngtemplates"]);
};
出力結果
templates.js
PREFIX
'use strict';
$templateCache.put('bar.html',
"this is bar.\n"
);
$templateCache.put('foo.html',
"this is foo.\n"
);
SUFFIX