Skip to content

Commit

Permalink
fix: explicit annotations for $templateCache dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
scottohara committed Feb 12, 2015
1 parent 5acefb9 commit d8f2ec5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/html2js.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
var util = require('util');


var TEMPLATE = 'angular.module(\'%s\', []).run(function($templateCache) {\n' +
var TEMPLATE = 'angular.module(\'%s\', []).run([\'$templateCache\', function($templateCache) {\n' +
' $templateCache.put(\'%s\',\n \'%s\');\n' +
'});\n';
'}]);\n';

var SINGLE_MODULE_TPL = '(function(module) {\n' +
'try {\n' +
' module = angular.module(\'%s\');\n' +
'} catch (e) {\n' +
' module = angular.module(\'%s\', []);\n' +
'}\n' +
'module.run(function($templateCache) {\n' +
'module.run([\'$templateCache\', function($templateCache) {\n' +
' $templateCache.put(\'%s\',\n \'%s\');\n' +
'});\n' +
'}]);\n' +
'})();\n';

var escapeContent = function(content) {
Expand Down
3 changes: 2 additions & 1 deletion test/helpers/template_cache.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ module.exports = (chai, utils) ->
templates = @templates = {}

run: (block) ->
block
# Block is an annotation array ["$templateCache", function($templateCache) {..}]
block[1]
put: (id, content) =>
@templates[id] = content

Expand Down

0 comments on commit d8f2ec5

Please sign in to comment.