diff --git a/js/ngDialog.js b/js/ngDialog.js index c63627f0..b9206794 100644 --- a/js/ngDialog.js +++ b/js/ngDialog.js @@ -441,8 +441,6 @@ var template = setup.template, locals = setup.locals; - $templateCache.put(options.template || options.templateUrl, template); - if (options.showClose) { template += '
'; } @@ -605,7 +603,7 @@ return loadTemplateUrl(tmpl, {cache: false}); } - return $templateCache.get(tmpl) || loadTemplateUrl(tmpl, {cache: true}); + return loadTemplateUrl(tmpl, {cache: $templateCache}); } }, diff --git a/tests/ngDialog.spec.js b/tests/ngDialog.spec.js index 0779069e..c830f11e 100644 --- a/tests/ngDialog.spec.js +++ b/tests/ngDialog.spec.js @@ -80,6 +80,29 @@ describe('ngDialog', function () { })); }); + describe('with already cached template URL', function () { + var elm; + beforeEach(inject(function (ngDialog, $timeout, $document, $httpBackend, $compile, $rootScope) { + $httpBackend.whenGET('cached.html').respond('some text {{1 + 1}}