MCPcopy
hub / github.com/angular-ui/ui-router / nodeLinkFn

Function nodeLinkFn

test/angular/1.7/angular.js:10465–10641  ·  view source on GitHub ↗
(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn)

Source from the content-addressed store, hash-verified

10463 }
10464
10465 function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) {
10466 var i, ii, linkFn, isolateScope, controllerScope, elementControllers, transcludeFn, $element,
10467 attrs, scopeBindingInfo;
10468
10469 if (compileNode === linkNode) {
10470 attrs = templateAttrs;
10471 $element = templateAttrs.$$element;
10472 } else {
10473 $element = jqLite(linkNode);
10474 attrs = new Attributes($element, templateAttrs);
10475 }
10476
10477 controllerScope = scope;
10478 if (newIsolateScopeDirective) {
10479 isolateScope = scope.$new(true);
10480 } else if (newScopeDirective) {
10481 controllerScope = scope.$parent;
10482 }
10483
10484 if (boundTranscludeFn) {
10485 // track `boundTranscludeFn` so it can be unwrapped if `transcludeFn`
10486 // is later passed as `parentBoundTranscludeFn` to `publicLinkFn`
10487 transcludeFn = controllersBoundTransclude;
10488 transcludeFn.$$boundTransclude = boundTranscludeFn;
10489 // expose the slots on the `$transclude` function
10490 transcludeFn.isSlotFilled = function(slotName) {
10491 return !!boundTranscludeFn.$$slots[slotName];
10492 };
10493 }
10494
10495 if (controllerDirectives) {
10496 elementControllers = setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope, newIsolateScopeDirective);
10497 }
10498
10499 if (newIsolateScopeDirective) {
10500 // Initialize isolate scope bindings for new isolate scope directive.
10501 compile.$$addScopeInfo($element, isolateScope, true, !(templateDirective && (templateDirective === newIsolateScopeDirective ||
10502 templateDirective === newIsolateScopeDirective.$$originalDirective)));
10503 compile.$$addScopeClass($element, true);
10504 isolateScope.$$isolateBindings =
10505 newIsolateScopeDirective.$$isolateBindings;
10506 scopeBindingInfo = initializeDirectiveBindings(scope, attrs, isolateScope,
10507 isolateScope.$$isolateBindings,
10508 newIsolateScopeDirective);
10509 if (scopeBindingInfo.removeWatches) {
10510 isolateScope.$on('$destroy', scopeBindingInfo.removeWatches);
10511 }
10512 }
10513
10514 // Initialize bindToController bindings
10515 for (var name in elementControllers) {
10516 var controllerDirective = controllerDirectives[name];
10517 var controller = elementControllers[name];
10518 var bindings = controllerDirective.$$bindings.bindToController;
10519
10520 controller.instance = controller();
10521 $element.data('$' + controllerDirective.name + 'Controller', controller.instance);
10522 controller.bindingInfo =

Callers 1

compositeLinkFnFunction · 0.70

Calls 11

controllerFunction · 0.85
isArrayFunction · 0.85
$onInitMethod · 0.80
setupControllersFunction · 0.70
forEachFunction · 0.70
isObjectFunction · 0.70
extendFunction · 0.70
getControllersFunction · 0.70
isFunctionFunction · 0.70
invokeLinkFnFunction · 0.70

Tested by

no test coverage detected