angular-json-precache

1.0.2 • Public • Published

angular-json-precache

Grunt task for precaching JSON data for angular projects. This is designed to work with angular-translate's [angular-translate-cache caching features].

Note: This task is since version 1.0.3 only compatible with Grunt ^1.0.3.

Getting Started

Install this grunt plugin next to your project's [grunt.js gruntfile] getting_started with:

npm install angular-json-precache --save-dev

Then add this line to your project's grunt.js gruntfile:

grunt.loadNpmTasks('angular-json-precache');

The "angular-json-precache" task

Overview

Setup

Gotchas

Options

cache

Type: String Default: json-precache

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 Function Default value: json-precache

single

Type: String or Boolean Default value: false

Using false creates one file for each JSON src file. With true, the JSON results are concatenated into one file, using the default module name json-precache.

A String allows you to specify the module name.

jsonmin

Type: Boolean Default value: true

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 Default value: (function(angular) {

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 Default value: })(angular);

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.

License

Copyright (c) 2016-2018 Karl Schaefer Licensed under the MIT license.

Package Sidebar

Install

npm i angular-json-precache

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

7.62 kB

Total Files

6

Last publish

Collaborators

  • kschaefe