File tree 2 files changed +43
-1
lines changed
2 files changed +43
-1
lines changed Original file line number Diff line number Diff line change @@ -162,7 +162,6 @@ var ngTranscludeMinErr = minErr('ngTransclude');
162
162
var ngTranscludeDirective = [ '$compile' , function ( $compile ) {
163
163
return {
164
164
restrict : 'EAC' ,
165
- terminal : true ,
166
165
compile : function ngTranscludeCompile ( tElement ) {
167
166
168
167
// Remove and cache any original content to act as a fallback
Original file line number Diff line number Diff line change @@ -8630,6 +8630,49 @@ describe('$compile', function() {
8630
8630
} ) ;
8631
8631
8632
8632
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
+
8633
8676
it ( 'should not merge text elements from transcluded content' , function ( ) {
8634
8677
module ( function ( ) {
8635
8678
directive ( 'foo' , valueFn ( {
You can’t perform that action at this time.
0 commit comments