Skip to content

Commit 06fa286

Browse files
committed
revert: "fix($compile): render nested transclusion at the root of a template"
This reverts commit 6d1e7cd. This commit was causing breakages because of its assumption that transcluded content would be handled predictably, i.e. with ngTransclude, whereas many use cases involve manipulating transcluded content in linking functions.
1 parent bd8ad0f commit 06fa286

File tree

2 files changed

+0
-35
lines changed

2 files changed

+0
-35
lines changed

src/ng/compile.js

-4
Original file line numberDiff line numberDiff line change
@@ -997,10 +997,6 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
997997
? JQLitePrototype.clone.call(namespaceAdaptedCompileNodes) // IMPORTANT!!!
998998
: namespaceAdaptedCompileNodes;
999999

1000-
if ( $linkNode.length === 0 && parentBoundTranscludeFn ) {
1001-
$linkNode = parentBoundTranscludeFn(scope);
1002-
}
1003-
10041000
if (transcludeControllers) {
10051001
for (var controllerName in transcludeControllers) {
10061002
$linkNode.data('$' + controllerName + 'Controller', transcludeControllers[controllerName].instance);

test/ng/compileSpec.js

-31
Original file line numberDiff line numberDiff line change
@@ -4927,37 +4927,6 @@ describe('$compile', function() {
49274927
});
49284928

49294929

4930-
describe('collocated nested transcludes', function() {
4931-
4932-
beforeEach(module(function($compileProvider) {
4933-
4934-
$compileProvider.directive('inner', valueFn({
4935-
restrict: 'E',
4936-
transclude: true,
4937-
template: '<u ng-transclude></u>'
4938-
}));
4939-
4940-
$compileProvider.directive('outer', valueFn({
4941-
restrict: 'E',
4942-
transclude: true,
4943-
template: '<a href="#"><inner ng-transclude></inner></a>'
4944-
}));
4945-
4946-
}));
4947-
4948-
4949-
// Issue #8914
4950-
it('should render nested transclusion at the root of a template', inject(function($compile, $rootScope) {
4951-
4952-
element = $compile('<div><outer>transcluded content</outer></div>')($rootScope);
4953-
$rootScope.$digest();
4954-
expect(element.text()).toEqual('transcluded content');
4955-
4956-
}));
4957-
4958-
});
4959-
4960-
49614930
describe('nested transcludes', function() {
49624931

49634932
beforeEach(module(function($compileProvider) {

0 commit comments

Comments
 (0)