Precache JSON files during angular startup. Useful for angular-translate, etc.
npm install angular-json-precacheNote: This task is since version 1.0.3 only compatible with Grunt ^1.0.3.
[angular-translate]: https://angular-translate.github.io/
[angular-translate-cache]: https://angular-translate.github.io/docs/#/guide/12_asynchronous-loading
``shell`
npm install angular-json-precache --save-dev
Then add this line to your project's grunt.js gruntfile:
`javascript`
grunt.loadNpmTasks('angular-json-precache');
[grunt]: http://gruntjs.com/
[getting_started]: https://github.com/gruntjs/grunt/blob/master/docs/getting_started.md
#### cache
Type: Stringjson-precache
Default:
The angular cache to use. The value $templateCache will use angular's $templateCache im lieu of a new self-contained cache object.
#### module
Type: String or Functionjson-precache
Default value:
#### single
Type: String or Booleanfalse
Default value:
Using false creates one file for each JSON src file. With true, the JSONjson-precache
results are concatenated into one file, using the default module name .
A String allows you to specify the module name.
#### jsonmin
Type: Booleantrue
Default value:
Use false to prevent minifying the JSON data. This minification helps remove
lots of extra data because the JSON is used is JavaScript and really just needs
to be JSON-like. In other words, we can remove quotes around object keys.
#### header
Type: String(function(angular) {
Default value:
A header to use to wrap the generated content. AMD users can simply replace this
with the define call that they need.
#### footer
Type: String})(angular);
Default value:
A footer to use to wrap the generated content.
#### rename
Type: Function`
Default value: empty
A function that takes the path. Must return a string.