grunt-angular-template

0.1.2 • Public • Published

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

Dependents (0)

Package Sidebar

Install

npm i grunt-angular-template

Weekly Downloads

4

Version

0.1.2

License

none

Last publish

Collaborators

  • nescalante