fix(ngTransclude): remove terminal: true

This was introduced in commit 2adaff083f,
but made obsolete in 41f3269bfb.

Fixes #16411
Closes #16412
This commit is contained in:
Martin Staffa
2018-01-17 12:03:05 +01:00
committed by GitHub
parent 507185979f
commit ab386cdef2
2 changed files with 43 additions and 1 deletions
-1
View File
@@ -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
+43
View File
@@ -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({