Skip to content

Commit 14e7ef2

Browse files
committed
fix(ngTransclude): remove terminal: true
This was introduced in commit 2adaff0, but made obsolete in 41f3269. Fixes angular#16411 Closes angular#16412
1 parent b300b67 commit 14e7ef2

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
@@ -8630,6 +8630,49 @@ describe('$compile', function() {
86308630
});
86318631

86328632

8633+
it('should compile directives with lower priority than ngTransclude', function() {
8634+
var ngTranscludePriority;
8635+
var lowerPriority = -1;
8636+
8637+
module(function($provide) {
8638+
$provide.decorator('ngTranscludeDirective', function($delegate) {
8639+
ngTranscludePriority = $delegate[0].priority;
8640+
return $delegate;
8641+
});
8642+
8643+
directive('lower', function(log) {
8644+
return {
8645+
priority: lowerPriority,
8646+
link: {
8647+
pre: function() {
8648+
log('pre');
8649+
},
8650+
post: function() {
8651+
log('post');
8652+
}
8653+
}
8654+
};
8655+
});
8656+
directive('trans', function(log) {
8657+
return {
8658+
transclude: true,
8659+
template: '<div lower ng-transclude></div>'
8660+
};
8661+
});
8662+
});
8663+
inject(function(log, $rootScope, $compile) {
8664+
element = $compile('<div trans><span>transcluded content</span></div>')($rootScope);
8665+
8666+
expect(lowerPriority).toBeLessThan(ngTranscludePriority);
8667+
8668+
$rootScope.$apply();
8669+
8670+
expect(element.text()).toEqual('transcluded content');
8671+
expect(log).toEqual('pre; post');
8672+
});
8673+
});
8674+
8675+
86338676
it('should not merge text elements from transcluded content', function() {
86348677
module(function() {
86358678
directive('foo', valueFn({

0 commit comments

Comments
 (0)