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

fix(ngTransclude): remove terminal: true #16412

Merged
merged 1 commit into from
Jan 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/ng/directive/ngTransclude.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ var ngTranscludeMinErr = minErr('ngTransclude');
var ngTranscludeDirective = ['$compile', function($compile) {
return {
restrict: 'EAC',
terminal: true,
compile: function ngTranscludeCompile(tElement) {

// Remove and cache any original content to act as a fallback
Expand Down
43 changes: 43 additions & 0 deletions test/ng/compileSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8582,6 +8582,49 @@ describe('$compile', function() {
});


it('should compile directives with lower priority than ngTransclude', function() {
var ngTranscludePriority;
var lowerPriority = -1;

module(function($provide) {
$provide.decorator('ngTranscludeDirective', function($delegate) {
ngTranscludePriority = $delegate[0].priority;
return $delegate;
});

directive('lower', function(log) {
return {
priority: lowerPriority,
link: {
pre: function() {
log('pre');
},
post: function() {
log('post');
}
}
};
});
directive('trans', function(log) {
return {
transclude: true,
template: '<div lower ng-transclude></div>'
};
});
});
inject(function(log, $rootScope, $compile) {
element = $compile('<div trans><span>transcluded content</span></div>')($rootScope);

expect(lowerPriority).toBeLessThan(ngTranscludePriority);

$rootScope.$apply();

expect(element.text()).toEqual('transcluded content');
expect(log).toEqual('pre; post');
});
});


it('should not merge text elements from transcluded content', function() {
module(function() {
directive('foo', valueFn({
Expand Down