MCPcopy Index your code
hub / github.com/angular-ui/ui-router / compositeLinkFn

Function compositeLinkFn

test/angular/1.2/angular.js:6120–6162  ·  view source on GitHub ↗
(scope, nodeList, $rootElement, parentBoundTranscludeFn)

Source from the content-addressed store, hash-verified

6118 return linkFnFound ? compositeLinkFn : null;
6119
6120 function compositeLinkFn(scope, nodeList, $rootElement, parentBoundTranscludeFn) {
6121 var nodeLinkFn, childLinkFn, node, childScope, i, ii, n, childBoundTranscludeFn;
6122
6123 // copy nodeList so that linking doesn't break due to live list updates.
6124 var nodeListLength = nodeList.length,
6125 stableNodeList = new Array(nodeListLength);
6126 for (i = 0; i < nodeListLength; i++) {
6127 stableNodeList[i] = nodeList[i];
6128 }
6129
6130 for(i = 0, n = 0, ii = linkFns.length; i < ii; n++) {
6131 node = stableNodeList[n];
6132 nodeLinkFn = linkFns[i++];
6133 childLinkFn = linkFns[i++];
6134
6135 if (nodeLinkFn) {
6136 if (nodeLinkFn.scope) {
6137 childScope = scope.$new();
6138 jqLite.data(node, '$scope', childScope);
6139 } else {
6140 childScope = scope;
6141 }
6142
6143 if ( nodeLinkFn.transcludeOnThisElement ) {
6144 childBoundTranscludeFn = createBoundTranscludeFn(scope, nodeLinkFn.transclude, parentBoundTranscludeFn);
6145
6146 } else if (!nodeLinkFn.templateOnThisElement && parentBoundTranscludeFn) {
6147 childBoundTranscludeFn = parentBoundTranscludeFn;
6148
6149 } else if (!parentBoundTranscludeFn && transcludeFn) {
6150 childBoundTranscludeFn = createBoundTranscludeFn(scope, transcludeFn);
6151
6152 } else {
6153 childBoundTranscludeFn = null;
6154 }
6155
6156 nodeLinkFn(childLinkFn, childScope, node, $rootElement, childBoundTranscludeFn);
6157
6158 } else if (childLinkFn) {
6159 childLinkFn(scope, node.childNodes, undefined, parentBoundTranscludeFn);
6160 }
6161 }
6162 }
6163 }
6164
6165 function createBoundTranscludeFn(scope, transcludeFn, previousBoundTranscludeFn) {

Callers 1

compileFunction · 0.70

Calls 2

createBoundTranscludeFnFunction · 0.70
nodeLinkFnFunction · 0.70

Tested by

no test coverage detected