MCPcopy Create free account
hub / github.com/apache/cloudstack / compositeLinkFn

Function compositeLinkFn

tools/ngui/static/js/lib/angular.js:3980–4021  ·  view source on GitHub ↗
(scope, nodeList, $rootElement, boundTranscludeFn)

Source from the content-addressed store, hash-verified

3978 return linkFnFound ? compositeLinkFn : null;
3979
3980 function compositeLinkFn(scope, nodeList, $rootElement, boundTranscludeFn) {
3981 var nodeLinkFn, childLinkFn, node, childScope, childTranscludeFn, i, ii, n;
3982
3983 // copy nodeList so that linking doesn't break due to live list updates.
3984 var stableNodeList = [];
3985 for (i = 0, ii = nodeList.length; i < ii; i++) {
3986 stableNodeList.push(nodeList[i]);
3987 }
3988
3989 for(i = 0, n = 0, ii = linkFns.length; i < ii; n++) {
3990 node = stableNodeList[n];
3991 nodeLinkFn = linkFns[i++];
3992 childLinkFn = linkFns[i++];
3993
3994 if (nodeLinkFn) {
3995 if (nodeLinkFn.scope) {
3996 childScope = scope.$new(isObject(nodeLinkFn.scope));
3997 jqLite(node).data('$scope', childScope);
3998 } else {
3999 childScope = scope;
4000 }
4001 childTranscludeFn = nodeLinkFn.transclude;
4002 if (childTranscludeFn || (!boundTranscludeFn && transcludeFn)) {
4003 nodeLinkFn(childLinkFn, childScope, node, $rootElement,
4004 (function(transcludeFn) {
4005 return function(cloneFn) {
4006 var transcludeScope = scope.$new();
4007 transcludeScope.$$transcluded = true;
4008
4009 return transcludeFn(transcludeScope, cloneFn).
4010 bind('$destroy', bind(transcludeScope, transcludeScope.$destroy));
4011 };
4012 })(childTranscludeFn || transcludeFn)
4013 );
4014 } else {
4015 nodeLinkFn(childLinkFn, childScope, node, undefined, boundTranscludeFn);
4016 }
4017 } else if (childLinkFn) {
4018 childLinkFn(scope, node.childNodes, undefined, boundTranscludeFn);
4019 }
4020 }
4021 }
4022 }
4023
4024

Callers 1

compileFunction · 0.85

Calls 4

isObjectFunction · 0.85
nodeLinkFnFunction · 0.85
bindFunction · 0.85
dataMethod · 0.45

Tested by

no test coverage detected