grunt-angular-templates
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -61,2 +61,10 @@ /* | ||
dest: 'tmp/simple_prepend.js' | ||
}, | ||
target: { | ||
options: { | ||
base: 'test/fixtures', | ||
module: 'ImAModuleNotATarget' | ||
}, | ||
src: ['test/fixtures/simple.html'], | ||
dest: 'tmp/options_module.js' | ||
} | ||
@@ -63,0 +71,0 @@ } |
{ | ||
"name": "grunt-angular-templates", | ||
"description": "Grunt build task to concatenate & register your AngularJS templates in the $templateCache", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"homepage": "https://github.com/ericclemmons/grunt-angular-templates", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -34,7 +34,9 @@ # grunt-angular-templates [![Build Status](https://travis-ci.org/ericclemmons/grunt-angular-templates.png?branch=master)](https://travis-ci.org/ericclemmons/grunt-angular-templates) | ||
grunt.initConfig({ | ||
ngtemplates: { | ||
myapp: { | ||
options: { | ||
ngtemplates: { | ||
build: { | ||
options: { | ||
base: 'src/views', // $templateCache ID will be relative to this folder | ||
prepend: '/static/assets/' // (Optional) Prepend path to $templateCache ID | ||
prepend: '/static/assets/', // (Optional) Prepend path to $templateCache ID | ||
module: 'App' // (Optional) The module the templates will be added to | ||
// Defaults to target name (e.g. `build`) | ||
}, | ||
@@ -48,9 +50,6 @@ src: [ 'src/views/**.html' ], | ||
**You should name your sub-target (e.g. `myapp`) after the name of the module the templates will be added to**. | ||
This will generate the following at `dist/templates.js`: | ||
```js | ||
angular.module('myapp').run(['$templateCache', function($templateCache) { | ||
angular.module('App').run(['$templateCache', function($templateCache) { | ||
... | ||
@@ -85,2 +84,6 @@ }]); | ||
### v0.3.2 | ||
- Add `module` option for setting which module the templates will be added to, thanks to @sidwood ([#20](https://github.com/ericclemmons/grunt-angular-templates/pull/20)) | ||
### v0.3.1 | ||
@@ -87,0 +90,0 @@ |
@@ -18,3 +18,3 @@ /* | ||
grunt.registerMultiTask('ngtemplates', 'Compile AngularJS templates', function() { | ||
var id = this.target; | ||
var id = this.options().module || this.target; | ||
var files = grunt.file.expand(this.files[0].src); | ||
@@ -21,0 +21,0 @@ var dest = path.normalize(this.files[0].dest); |
@@ -36,4 +36,14 @@ 'use strict'; | ||
test.done(); | ||
}, | ||
module: function(test) { | ||
test.expect(1); | ||
var actual = grunt.file.read('tmp/options_module.js'); | ||
var expected = grunt.file.read('test/expected/options_module.js'); | ||
test.equal(expected, actual, 'should set the angular module to the provided options value'); | ||
test.done(); | ||
} | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12627
17
210
141