ng-cache-loader
Advanced tools
Comparing version 0.0.20 to 0.0.21
@@ -18,3 +18,6 @@ /* | ||
'var id${i}="${key}";\n' + | ||
'ngModule.run(["$templateCache",function(c){c.put(id${i},v${i})}]);'; | ||
// added injector to load $templateCache for dynamic chunks | ||
'var inj=angular.element(window.document).injector();\n' + | ||
'if(inj){inj.get("$templateCache").put(id${i},v${i});}\n' + | ||
'else{ngModule.run(["$templateCache",function(c){c.put(id${i},v${i})}]);}'; | ||
@@ -21,0 +24,0 @@ /** |
{ | ||
"name": "ng-cache-loader", | ||
"version": "0.0.20", | ||
"version": "0.0.21", | ||
"description": "Puts HTML partials in the Angular's $templateCache.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -59,9 +59,15 @@ /******/ (function(modules) { // webpackBootstrap | ||
var id1="myAnotherTemplate"; | ||
ngModule.run(["$templateCache",function(c){c.put(id1,v1)}]); | ||
var inj=angular.element(window.document).injector(); | ||
if(inj){inj.get("$templateCache").put(id1,v1);} | ||
else{ngModule.run(["$templateCache",function(c){c.put(id1,v1)}]);} | ||
var v2="\n<div class=\"view\">\n <h2>First View</h2>\n <p>\n Search:<input type=\"text\" ng-model=\"filterText\" />\n </p>\n </div>\n"; | ||
var id2="myTemplate"; | ||
ngModule.run(["$templateCache",function(c){c.put(id2,v2)}]); | ||
var inj=angular.element(window.document).injector(); | ||
if(inj){inj.get("$templateCache").put(id2,v2);} | ||
else{ngModule.run(["$templateCache",function(c){c.put(id2,v2)}]);} | ||
var v3="\n<div class=\"view\">\n<h2>Second View</h2>\n<p>About me</p>\n</div>\n\n<div class=\"view\">\n<h2>Second View</h2>\n<p>About you</p>\n</div>\n\n<div class=\"view\"></div>\n"; | ||
var id3="grot/teux/ng-cache-loader/tmpl/template.tpl"; | ||
ngModule.run(["$templateCache",function(c){c.put(id3,v3)}]); | ||
var inj=angular.element(window.document).injector(); | ||
if(inj){inj.get("$templateCache").put(id3,v3);} | ||
else{ngModule.run(["$templateCache",function(c){c.put(id3,v3)}]);} | ||
module.exports=v3; | ||
@@ -68,0 +74,0 @@ |
42379
856