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

Commit ad0c510

Browse files
petebacondarwinvojtajina
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 1fef5fe commit ad0c510

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
@@ -935,7 +935,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
935935
// return a linking function if we have found anything, null otherwise
936936
return linkFnFound ? compositeLinkFn : null;
937937

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

941941
// copy nodeList so that linking doesn't break due to live list updates.
@@ -962,17 +962,17 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
962962
// We need to create a new boundTranscludeFn if
963963
// - a directive on this element wants to transclude
964964
// or
965-
// - there is no boundTranscludeFn already and a transcludeFn was passed in
966-
if ( nodeLinkFn.transcludeOnThisElement || (!boundTranscludeFn && transcludeFn) ) {
965+
// - there is no parentBoundTranscludeFn already and a transcludeFn was passed in
966+
if ( nodeLinkFn.transcludeOnThisElement || (!parentBoundTranscludeFn && transcludeFn) ) {
967967
childBoundTranscludeFn = createBoundTranscludeFn(scope, nodeLinkFn.transclude || transcludeFn);
968968
} else {
969-
childBoundTranscludeFn = boundTranscludeFn;
969+
childBoundTranscludeFn = parentBoundTranscludeFn;
970970
}
971971

972972
nodeLinkFn(childLinkFn, childScope, node, $rootElement, childBoundTranscludeFn);
973973

974974
} else if (childLinkFn) {
975-
childLinkFn(scope, node.childNodes, undefined, boundTranscludeFn);
975+
childLinkFn(scope, node.childNodes, undefined, parentBoundTranscludeFn);
976976
}
977977
}
978978
}

0 commit comments

Comments
 (0)