JSPM

angular-json-precache

1.0.2
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 5
    • Score
      100M100P100Q21540F
    • License MIT

    Precache JSON files during angular startup. Useful for angular-translate, etc.

    Package Exports

    • angular-json-precache

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (angular-json-precache) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    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.

    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.

    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.