From 0a7cbb33b06778833a4d99b1868cc07690a827a7 Mon Sep 17 00:00:00 2001 From: Tobias Bosch Date: Thu, 21 Nov 2013 21:54:42 -0800 Subject: fix(ngInclude): Don't throw when the ngInclude element contains content with directives. Related to #5069 --- test/ng/directive/ngIncludeSpec.js | 40 ++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) (limited to 'test/ng/directive') diff --git a/test/ng/directive/ngIncludeSpec.js b/test/ng/directive/ngIncludeSpec.js index 59f8b4ae..2d115e8b 100644 --- a/test/ng/directive/ngIncludeSpec.js +++ b/test/ng/directive/ngIncludeSpec.js @@ -465,10 +465,22 @@ describe('ngInclude', function() { }); describe('ngInclude and transcludes', function() { + var element, directive; + + beforeEach(module(function($compileProvider) { + element = null; + directive = $compileProvider.directive; + })); + + afterEach(function() { + if (element) { + dealoc(element); + } + }); + it('should allow access to directive controller from children when used in a replace template', function() { var controller; - module(function($compileProvider) { - var directive = $compileProvider.directive; + module(function() { directive('template', valueFn({ template: '
', replace: true, @@ -485,13 +497,33 @@ describe('ngInclude and transcludes', function() { }); inject(function($compile, $rootScope, $httpBackend) { $httpBackend.expectGET('include.html').respond('