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

Commit 30279d7

Browse files
petebacondarwincaitp
authored andcommitted
refactor($compile): change parameter name
The boundTransclusionFn that is passed in is really the one from the parent node. The change to parentBoundTranscludeFn clarifies this compared to the childBoundTranscludeFn.
1 parent 8df5f32 commit 30279d7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/ng/compile.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
918918
// return a linking function if we have found anything, null otherwise
919919
return linkFnFound ? compositeLinkFn : null;
920920

921-
function compositeLinkFn(scope, nodeList, $rootElement, boundTranscludeFn) {
921+
function compositeLinkFn(scope, nodeList, $rootElement, parentBoundTranscludeFn) {
922922
var nodeLinkFn, childLinkFn, node, $node, childScope, i, ii, n, childBoundTranscludeFn;
923923

924924
// copy nodeList so that linking doesn't break due to live list updates.
@@ -945,17 +945,17 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
945945
// We need to create a new boundTranscludeFn if
946946
// - a directive on this element wants to transclude
947947
// or
948-
// - there is no boundTranscludeFn already and a transcludeFn was passed in
949-
if ( nodeLinkFn.transcludeOnThisElement || (!boundTranscludeFn && transcludeFn) ) {
948+
// - there is no parentBoundTranscludeFn already and a transcludeFn was passed in
949+
if ( nodeLinkFn.transcludeOnThisElement || (!parentBoundTranscludeFn && transcludeFn) ) {
950950
childBoundTranscludeFn = createBoundTranscludeFn(scope, nodeLinkFn.transclude || transcludeFn);
951951
} else {
952-
childBoundTranscludeFn = boundTranscludeFn;
952+
childBoundTranscludeFn = parentBoundTranscludeFn;
953953
}
954954

955955
nodeLinkFn(childLinkFn, childScope, node, $rootElement, childBoundTranscludeFn);
956956

957957
} else if (childLinkFn) {
958-
childLinkFn(scope, node.childNodes, undefined, boundTranscludeFn);
958+
childLinkFn(scope, node.childNodes, undefined, parentBoundTranscludeFn);
959959
}
960960
}
961961
}

0 commit comments

Comments
 (0)