grunt-angular-template
v0.1.2
Published
> Adds html template in `$templateCache` and writes file to destFile
Downloads
3
Readme
grunt-angular-template
Adds html template in
$templateCache
and writes file to destFile
Getting Started
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-angular-template --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-angular-template');
Usage example
ngtemplatecache: {
app: {
options: {
stripPrefix: ''
prependPrefix: '',
cacheIdFromPath: function(filepath) {
// gets set as $templateCache key
return filepath;
}
},
files: {
destFile: srcFile
}
}
}
$templateCache
key is the filepath passed in as srcFile:
options.prependPrefix + options.srcFile.replace(stripPrefix, '')
License
MIT