Permalink
Browse files

Fix templates compilation.

  • Loading branch information...
1 parent fef1d75 commit 7162e23b16c9d1ddbdf881e37522f87019b86716 @lucassus committed Jan 6, 2013
View
@@ -13,4 +13,4 @@ Gemfile.lock
*.gem
# ignore compiled templates
-app/assets/javascripts/templates/*.js
+app/assets/javascripts/templates
View
@@ -3,13 +3,13 @@ module.exports = function(grunt) {
grunt.initConfig({
watch: {
templates: {
- files: 'app/assets/templates/*.html',
- tasks: 'html2js:directives'
+ files: "public/ng/templates/**/*.html",
+ tasks: "html2js:directives"
}
},
html2js: {
- directives: ['app/assets/templates/*.html']
+ directives: ["public/ng/templates/**/*.html"]
}
});
@@ -19,14 +19,14 @@ module.exports = function(grunt) {
return content.replace(/"/g, '\\"').replace(/\n/g, '" +\n "');
};
- grunt.registerMultiTask('html2js', 'Generate js version of html template.', function() {
+ grunt.registerMultiTask("html2js", "Generate js version of html template.", function() {
var files = grunt._watch_changed_files || grunt.file.expand(this.data);
files.forEach(function(file) {
- var parts = file.split("/");
- var name = parts[parts.length - 1];
+ var parts = file.split("/").slice(3);
+ var name = parts.join("/");
- grunt.file.write("app/assets/javascripts/templates/" + name + '.js', grunt.template.process(TPL, {
+ grunt.file.write("app/assets/javascripts/templates/" + name + ".js", grunt.template.process(TPL, {
file: file,
path: "/ng/templates/" + file.split("/").pop(),
content: escapeContent(grunt.file.read(file))
@@ -41,7 +41,7 @@ describe "mb.alerts", ->
$scope = null
element = null
- beforeEach module("app/assets/templates/alerts.html")
+ beforeEach module("public/ng/templates/alerts.html")
beforeEach inject ($rootScope, $compile) ->
$scope = $rootScope
@@ -29,7 +29,7 @@ describe "mb.tableFilter", ->
$scope = null
element = null
- beforeEach module("app/assets/templates/table_filter.html")
+ beforeEach module("public/ng/templates/table_filter.html")
beforeEach inject ($rootScope, $compile) ->
$scope = $rootScope

0 comments on commit 7162e23

Please sign in to comment.