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.
This commit is contained in:
committed by
Caitlin Potter
parent
8df5f3259a
commit
30279d7b9b
+5
-5
@@ -918,7 +918,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
||||
// return a linking function if we have found anything, null otherwise
|
||||
return linkFnFound ? compositeLinkFn : null;
|
||||
|
||||
function compositeLinkFn(scope, nodeList, $rootElement, boundTranscludeFn) {
|
||||
function compositeLinkFn(scope, nodeList, $rootElement, parentBoundTranscludeFn) {
|
||||
var nodeLinkFn, childLinkFn, node, $node, childScope, i, ii, n, childBoundTranscludeFn;
|
||||
|
||||
// copy nodeList so that linking doesn't break due to live list updates.
|
||||
@@ -945,17 +945,17 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
||||
// We need to create a new boundTranscludeFn if
|
||||
// - a directive on this element wants to transclude
|
||||
// or
|
||||
// - there is no boundTranscludeFn already and a transcludeFn was passed in
|
||||
if ( nodeLinkFn.transcludeOnThisElement || (!boundTranscludeFn && transcludeFn) ) {
|
||||
// - there is no parentBoundTranscludeFn already and a transcludeFn was passed in
|
||||
if ( nodeLinkFn.transcludeOnThisElement || (!parentBoundTranscludeFn && transcludeFn) ) {
|
||||
childBoundTranscludeFn = createBoundTranscludeFn(scope, nodeLinkFn.transclude || transcludeFn);
|
||||
} else {
|
||||
childBoundTranscludeFn = boundTranscludeFn;
|
||||
childBoundTranscludeFn = parentBoundTranscludeFn;
|
||||
}
|
||||
|
||||
nodeLinkFn(childLinkFn, childScope, node, $rootElement, childBoundTranscludeFn);
|
||||
|
||||
} else if (childLinkFn) {
|
||||
childLinkFn(scope, node.childNodes, undefined, boundTranscludeFn);
|
||||
childLinkFn(scope, node.childNodes, undefined, parentBoundTranscludeFn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user