fix(ngTransclude): remove terminal: true
This was introduced in commit2adaff083f, but made obsolete in41f3269bfb. Fixes #16411 Closes #16412
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user