diff --git a/src/ng/templateRequest.js b/src/ng/templateRequest.js index edd58623..45fdb493 100644 --- a/src/ng/templateRequest.js +++ b/src/ng/templateRequest.js @@ -48,10 +48,6 @@ function $TemplateRequestProvider() { return $http.get(tpl, httpOptions) .then(function(response) { var html = response.data; - if (!html || html.length === 0) { - return handleError(); - } - self.totalPendingRequests--; $templateCache.put(tpl, html); return html; diff --git a/test/ng/templateRequestSpec.js b/test/ng/templateRequestSpec.js index 23b9dabb..5684b0c6 100644 --- a/test/ng/templateRequestSpec.js +++ b/test/ng/templateRequestSpec.js @@ -43,7 +43,7 @@ describe('$templateRequest', function() { }).toThrowMinErr('$compile', 'tpload', 'Failed to load template: tpl.html'); })); - it('should throw an error when the template is empty', + it('should not throw an error when the template is empty', inject(function($rootScope, $templateRequest, $httpBackend) { $httpBackend.expectGET('tpl.html').respond(''); @@ -55,7 +55,7 @@ describe('$templateRequest', function() { expect(function() { $rootScope.$digest(); $httpBackend.flush(); - }).toThrowMinErr('$compile', 'tpload', 'Failed to load template: tpl.html'); + }).not.toThrow(); })); it('should keep track of how many requests are going on', diff --git a/test/ngRoute/directive/ngViewSpec.js b/test/ngRoute/directive/ngViewSpec.js index 2c01f7be..a2ab0cce 100644 --- a/test/ngRoute/directive/ngViewSpec.js +++ b/test/ngRoute/directive/ngViewSpec.js @@ -56,7 +56,7 @@ describe('ngView', function() { }); - it('should not instantiate the associated controller when an empty template is downloaded', function() { + it('should instantiate the associated controller when an empty template is downloaded', function() { var log = [], controllerScope, Ctrl = function($scope) { controllerScope = $scope; @@ -73,9 +73,9 @@ describe('ngView', function() { expect(function() { $rootScope.$digest(); - }).toThrowMinErr('$compile', 'tpload', 'Failed to load template: /tpl.html'); + }).not.toThrow(); - expect(controllerScope).toBeUndefined(); + expect(controllerScope).toBeDefined(); }); }); diff --git a/test/ngRoute/routeSpec.js b/test/ngRoute/routeSpec.js index 3fdb4d14..45668c3c 100644 --- a/test/ngRoute/routeSpec.js +++ b/test/ngRoute/routeSpec.js @@ -744,7 +744,7 @@ describe('$route', function() { }); - it('should throw an error when a template is empty or not found', function() { + it('should throw an error when a template is not found', function() { module(function($routeProvider, $exceptionHandlerProvider) { $exceptionHandlerProvider.mode('log'); $routeProvider. @@ -766,7 +766,7 @@ describe('$route', function() { $rootScope.$digest(); $httpBackend.flush(); - expect($exceptionHandler.errors.pop().message).toContain("[$compile:tpload] Failed to load template: r2.html"); + expect($exceptionHandler.errors.length).toBe(0); $httpBackend.expectGET('r3.html').respond('abc'); $location.path('/r3');