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

Commit

Permalink
fix(ngTransclude): remove terminal: true
Browse files Browse the repository at this point in the history
This was introduced in commit 2adaff0,
but made obsolete in 41f3269.

Fixes #16411
Closes #16412
  • Loading branch information
Narretz committed Jan 17, 2018
1 parent 5071859 commit ab386cd
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/ng/directive/ngTransclude.js
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
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

0 comments on commit ab386cd

Please sign in to comment.