Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-angular-templates

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-angular-templates - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

test/expected/options_module.js

8

Gruntfile.js

@@ -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 @@ }

2

package.json
{
"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();
}
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc