grunt-contrib-templify
Advanced tools
Comparing version 0.1.51 to 0.2.0
@@ -9,5 +9,5 @@ module.exports = { | ||
}, | ||
"suffix": function() { | ||
"suffix": function(options) { | ||
return "};\n"; | ||
} | ||
}; |
@@ -14,3 +14,3 @@ module.exports = { | ||
}, | ||
"suffix": function() { | ||
"suffix": function(options) { | ||
return "\t\t\tdefault: return null;\n" + | ||
@@ -20,4 +20,4 @@ "\t\t}\n" + | ||
"};\n" + | ||
"Vue.use(Templify);"; | ||
(options.autoAffix?"Vue.use(Templify);":""); | ||
} | ||
}; |
{ | ||
"name": "grunt-contrib-templify", | ||
"version": "0.1.51", | ||
"version": "0.2.0", | ||
"description": "A simple project for quick and dirty conversion of HTML files to javascript for various cases, particularly unit testing.", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "grunt test" | ||
"test": "grunt test --stack" | ||
}, | ||
@@ -9,0 +9,0 @@ "repository": { |
@@ -54,3 +54,3 @@ # grunt-contrib-templify | ||
The task creates a function that simply binds the templates to the $templateCache. The generated function for *__templifyTemplates* as an example: | ||
Currently this refers to "AngularJS". The task creates a function that simply binds the templates to the $templateCache. The generated function for *__templifyTemplates* as an example: | ||
@@ -105,5 +105,11 @@ ```javascript | ||
#### angular+ | ||
Not yet implemented. | ||
To avoid mixing the afore-mentions `angular` mode that is for AngularV1 or AngularJS, the mode for Angular V2+ templating will use the mode `angular+`. | ||
#### jasmine-angular (Also karma-angular) | ||
The task creates a function that handles binding a beforeEach clause that adds the templates to the $templateCache. The equivalent code for __templifyTemplates as an example: | ||
Currently this refers to "AngularJS". The task creates a function that handles binding a beforeEach clause that adds the templates to the $templateCache. The equivalent code for __templifyTemplates as an example: | ||
@@ -145,7 +151,2 @@ ```javascript | ||
#### templates[].module | ||
Type: `String` | ||
*Currently unused.* Future use to allow separation of templates to be declared into their respective angular modules. | ||
#### templates[].trim | ||
@@ -177,2 +178,12 @@ Type: `String` | ||
#### autoAffix | ||
Type: `Boolean` | ||
When true, the created template file will attempt to automatically add the code necessary to add itself to the appropriate library. Such as `Vue.install`. | ||
#### module | ||
Type: `String` | ||
When `autoAffix` is true, this options is used for angularjs template files to automatically index the correct module for the $templateCache. | ||
## Usage Examples | ||
@@ -179,0 +190,0 @@ This is currently being written to quickly fill a specific issue of getting HTML templates into Jasmine tests for Angular while using Karma without too much craziness. |
23676
16
269