Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 513e008

Browse files
committed
fix(ngTransclude): remove terminal: true
This was introduced in commit 2adaff0, but made obsolete in 41f3269. Fixes #16411
1 parent ddbf197 commit 513e008

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

src/ng/directive/ngTransclude.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ var ngTranscludeMinErr = minErr('ngTransclude');
162162
var ngTranscludeDirective = ['$compile', function($compile) {
163163
return {
164164
restrict: 'EAC',
165-
terminal: true,
166165
compile: function ngTranscludeCompile(tElement) {
167166

168167
// Remove and cache any original content to act as a fallback

test/ng/compileSpec.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8582,6 +8582,49 @@ describe('$compile', function() {
85828582
});
85838583

85848584

8585+
it('should compile directives with lower priority than ngTransclude', function() {
8586+
var ngTranscludePriority;
8587+
var lowerPriority = -1;
8588+
8589+
module(function($provide) {
8590+
$provide.decorator('ngTranscludeDirective', function($delegate) {
8591+
ngTranscludePriority = $delegate[0].priority;
8592+
return $delegate;
8593+
});
8594+
8595+
directive('lower', function(log) {
8596+
return {
8597+
priority: lowerPriority,
8598+
link: {
8599+
pre: function() {
8600+
log('pre');
8601+
},
8602+
post: function() {
8603+
log('post');
8604+
}
8605+
}
8606+
};
8607+
});
8608+
directive('trans', function(log) {
8609+
return {
8610+
transclude: true,
8611+
template: '<div lower ng-transclude></div>'
8612+
};
8613+
});
8614+
});
8615+
inject(function(log, $rootScope, $compile) {
8616+
element = $compile('<div trans><span>transcluded content</span></div>')($rootScope);
8617+
8618+
expect(lowerPriority).toBeLessThan(ngTranscludePriority);
8619+
8620+
$rootScope.$apply();
8621+
8622+
expect(element.text()).toEqual('transcluded content');
8623+
expect(log).toEqual('pre; post');
8624+
});
8625+
});
8626+
8627+
85858628
it('should not merge text elements from transcluded content', function() {
85868629
module(function() {
85878630
directive('foo', valueFn({

0 commit comments

Comments
 (0)