@@ -585,11 +585,11 @@ function $CompileProvider($provide) {
585
585
* @param {Object } templateAttrs The shared attribute function
586
586
* @param {function(angular.Scope[, cloneAttachFn] } transcludeFn A linking function, where the
587
587
* scope argument is auto-generated to the new child of the transcluded parent scope.
588
- * @param {DOMElement } $rootElement If we are working on the root of the compile tree then this
589
- * argument has the root jqLite array so that we can replace widgets on it.
588
+ * @param {JQLite } jqCollection If we are working on the root of the compile tree then this
589
+ * argument has the root jqLite array so that we can replace nodes on it.
590
590
* @returns linkFn
591
591
*/
592
- function applyDirectivesToNode ( directives , compileNode , templateAttrs , transcludeFn , $rootElement ) {
592
+ function applyDirectivesToNode ( directives , compileNode , templateAttrs , transcludeFn , jqCollection ) {
593
593
var terminalPriority = - Number . MAX_VALUE ,
594
594
preLinkFns = [ ] ,
595
595
postLinkFns = [ ] ,
@@ -643,7 +643,7 @@ function $CompileProvider($provide) {
643
643
$compileNode = templateAttrs . $$element =
644
644
jqLite ( document . createComment ( ' ' + directiveName + ': ' + templateAttrs [ directiveName ] + ' ' ) ) ;
645
645
compileNode = $compileNode [ 0 ] ;
646
- replaceWith ( $rootElement , jqLite ( $template [ 0 ] ) , compileNode ) ;
646
+ replaceWith ( jqCollection , jqLite ( $template [ 0 ] ) , compileNode ) ;
647
647
childTranscludeFn = compile ( $template , transcludeFn , terminalPriority ) ;
648
648
} else {
649
649
$template = jqLite ( JQLiteClone ( compileNode ) ) . contents ( ) ;
@@ -672,7 +672,7 @@ function $CompileProvider($provide) {
672
672
throw new Error ( MULTI_ROOT_TEMPLATE_ERROR + directiveValue ) ;
673
673
}
674
674
675
- replaceWith ( $rootElement , $compileNode , compileNode ) ;
675
+ replaceWith ( jqCollection , $compileNode , compileNode ) ;
676
676
677
677
var newTemplateAttrs = { $attr : { } } ;
678
678
@@ -700,7 +700,7 @@ function $CompileProvider($provide) {
700
700
assertNoDuplicate ( 'template' , templateDirective , directive , $compileNode ) ;
701
701
templateDirective = directive ;
702
702
nodeLinkFn = compileTemplateUrl ( directives . splice ( i , directives . length - i ) ,
703
- nodeLinkFn , $compileNode , templateAttrs , $rootElement , directive . replace ,
703
+ nodeLinkFn , $compileNode , templateAttrs , jqCollection , directive . replace ,
704
704
childTranscludeFn ) ;
705
705
ii = directives . length ;
706
706
} else if ( directive . compile ) {
0 commit comments