grunt-angular-templates
Advanced tools
Comparing version 0.3.4 to 0.3.6
{ | ||
"name": "grunt-angular-templates", | ||
"description": "Grunt build task to concatenate & register your AngularJS templates in the $templateCache", | ||
"version": "0.3.4", | ||
"version": "0.3.6", | ||
"homepage": "https://github.com/ericclemmons/grunt-angular-templates", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -137,2 +137,10 @@ # grunt-angular-templates [![Build Status](https://travis-ci.org/ericclemmons/grunt-angular-templates.png?branch=master)](https://travis-ci.org/ericclemmons/grunt-angular-templates) | ||
### v0.3.6 | ||
- Fix issue with dading to `concat` task when it's an array, thanks to @codefather ([#23](https://github.com/ericclemmons/grunt-angular-templates/pull/23)) | ||
### v0.3.5 | ||
- Preserver line endings in templates, thanks to @groner ([#21](https://github.com/ericclemmons/grunt-angular-templates/pull/21)) | ||
### v0.3.4 | ||
@@ -139,0 +147,0 @@ |
@@ -56,2 +56,4 @@ /* | ||
} | ||
} else if (Array.isArray(task)) { | ||
task.push(dest); | ||
} else { | ||
@@ -58,0 +60,0 @@ grunt.log.error('Could not find src or files in concat target: ' + target); |
@@ -18,4 +18,4 @@ /* | ||
var id = (options.prepend || '') + path.relative(options.base || '.', file).replace( /\\/g, '/'); | ||
var template = '\n $templateCache.put("<%= id %>",\n "<%= content %>"\n );\n'; | ||
var cleaned = grunt.file.read(file).replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\r?\n/g, '" +\n "'); | ||
var template = '\n $templateCache.put("<%= id %>",\n <%= content %>\n );\n'; | ||
var cleaned = grunt.file.read(file).split(/^/gm).map(function(line) { return JSON.stringify(line); }).join(' +\n '); | ||
var cached = process(template, id, cleaned); | ||
@@ -22,0 +22,0 @@ |
angular.module("multiple").run(["$templateCache", function($templateCache) { | ||
$templateCache.put("multiple/one.html", | ||
"<h1>One</h1>" + | ||
"" + | ||
"<p>I am one.</p>" + | ||
"" + | ||
"<script>" + | ||
" // Test" + | ||
" /* comments */" + | ||
" var foo = 'bar';" + | ||
"</script>" + | ||
"" | ||
"<h1>One</h1>\n" + | ||
"\n" + | ||
"<p>I am one.</p>\n" + | ||
"\n" + | ||
"<script>\n" + | ||
" // Test\n" + | ||
" /* comments */\n" + | ||
" var foo = 'bar';\n" + | ||
"</script>\n" | ||
); | ||
$templateCache.put("multiple/two/two.html", | ||
"<h2>Two</h2>" + | ||
"" + | ||
"<p>We are two.</p>" + | ||
"" | ||
"<h2>Two</h2>\n" + | ||
"\n" + | ||
"<p>We are two.</p>\n" | ||
); | ||
}]); |
angular.module("ImAModuleNotATarget").run(["$templateCache", function($templateCache) { | ||
$templateCache.put("simple.html", | ||
"Howdy there! \\ Your name is \"{{ name }}\"." + | ||
"" | ||
"Howdy there! \\ Your name is \"{{ name }}\".\n" | ||
); | ||
}]); |
angular.module("prepend").run(["$templateCache", function($templateCache) { | ||
$templateCache.put("/prepend/simple.html", | ||
"Howdy there! \\ Your name is \"{{ name }}\"." + | ||
"" | ||
"Howdy there! \\ Your name is \"{{ name }}\".\n" | ||
); | ||
}]); |
angular.module("simple").run(["$templateCache", function($templateCache) { | ||
$templateCache.put("simple.html", | ||
"Howdy there! \\ Your name is \"{{ name }}\"." + | ||
"" | ||
"Howdy there! \\ Your name is \"{{ name }}\".\n" | ||
); | ||
}]); |
17265
212
277