MCPcopy Create free account
hub / github.com/bclinkinbeard/angular / compositeLinkFn

Function compositeLinkFn

test/fixtures/foo.js:6062–6104  ·  view source on GitHub ↗
(scope, nodeList, $rootElement, parentBoundTranscludeFn)

Source from the content-addressed store, hash-verified

6060 return linkFnFound ? compositeLinkFn : null;
6061
6062 function compositeLinkFn(scope, nodeList, $rootElement, parentBoundTranscludeFn) {
6063 var nodeLinkFn, childLinkFn, node, childScope, i, ii, n, childBoundTranscludeFn;
6064
6065 // copy nodeList so that linking doesn't break due to live list updates.
6066 var nodeListLength = nodeList.length,
6067 stableNodeList = new Array(nodeListLength);
6068 for (i = 0; i < nodeListLength; i++) {
6069 stableNodeList[i] = nodeList[i];
6070 }
6071
6072 for(i = 0, n = 0, ii = linkFns.length; i < ii; n++) {
6073 node = stableNodeList[n];
6074 nodeLinkFn = linkFns[i++];
6075 childLinkFn = linkFns[i++];
6076
6077 if (nodeLinkFn) {
6078 if (nodeLinkFn.scope) {
6079 childScope = scope.$new();
6080 jqLite.data(node, '$scope', childScope);
6081 } else {
6082 childScope = scope;
6083 }
6084
6085 if ( nodeLinkFn.transcludeOnThisElement ) {
6086 childBoundTranscludeFn = createBoundTranscludeFn(scope, nodeLinkFn.transclude, parentBoundTranscludeFn);
6087
6088 } else if (!nodeLinkFn.templateOnThisElement && parentBoundTranscludeFn) {
6089 childBoundTranscludeFn = parentBoundTranscludeFn;
6090
6091 } else if (!parentBoundTranscludeFn && transcludeFn) {
6092 childBoundTranscludeFn = createBoundTranscludeFn(scope, transcludeFn);
6093
6094 } else {
6095 childBoundTranscludeFn = null;
6096 }
6097
6098 nodeLinkFn(childLinkFn, childScope, node, $rootElement, childBoundTranscludeFn);
6099
6100 } else if (childLinkFn) {
6101 childLinkFn(scope, node.childNodes, undefined, parentBoundTranscludeFn);
6102 }
6103 }
6104 }
6105 }
6106
6107 function createBoundTranscludeFn(scope, transcludeFn, previousBoundTranscludeFn) {

Callers 1

compileFunction · 0.85

Calls 2

createBoundTranscludeFnFunction · 0.85
nodeLinkFnFunction · 0.85

Tested by

no test coverage detected