(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn)
| 9404 | } |
| 9405 | |
| 9406 | function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) { |
| 9407 | var i, ii, linkFn, isolateScope, controllerScope, elementControllers, transcludeFn, $element, |
| 9408 | attrs, scopeBindingInfo; |
| 9409 | |
| 9410 | if (compileNode === linkNode) { |
| 9411 | attrs = templateAttrs; |
| 9412 | $element = templateAttrs.$$element; |
| 9413 | } else { |
| 9414 | $element = jqLite(linkNode); |
| 9415 | attrs = new Attributes($element, templateAttrs); |
| 9416 | } |
| 9417 | |
| 9418 | controllerScope = scope; |
| 9419 | if (newIsolateScopeDirective) { |
| 9420 | isolateScope = scope.$new(true); |
| 9421 | } else if (newScopeDirective) { |
| 9422 | controllerScope = scope.$parent; |
| 9423 | } |
| 9424 | |
| 9425 | if (boundTranscludeFn) { |
| 9426 | // track `boundTranscludeFn` so it can be unwrapped if `transcludeFn` |
| 9427 | // is later passed as `parentBoundTranscludeFn` to `publicLinkFn` |
| 9428 | transcludeFn = controllersBoundTransclude; |
| 9429 | transcludeFn.$$boundTransclude = boundTranscludeFn; |
| 9430 | // expose the slots on the `$transclude` function |
| 9431 | transcludeFn.isSlotFilled = function(slotName) { |
| 9432 | return !!boundTranscludeFn.$$slots[slotName]; |
| 9433 | }; |
| 9434 | } |
| 9435 | |
| 9436 | if (controllerDirectives) { |
| 9437 | elementControllers = setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope, newIsolateScopeDirective); |
| 9438 | } |
| 9439 | |
| 9440 | if (newIsolateScopeDirective) { |
| 9441 | // Initialize isolate scope bindings for new isolate scope directive. |
| 9442 | compile.$$addScopeInfo($element, isolateScope, true, !(templateDirective && (templateDirective === newIsolateScopeDirective || |
| 9443 | templateDirective === newIsolateScopeDirective.$$originalDirective))); |
| 9444 | compile.$$addScopeClass($element, true); |
| 9445 | isolateScope.$$isolateBindings = |
| 9446 | newIsolateScopeDirective.$$isolateBindings; |
| 9447 | scopeBindingInfo = initializeDirectiveBindings(scope, attrs, isolateScope, |
| 9448 | isolateScope.$$isolateBindings, |
| 9449 | newIsolateScopeDirective); |
| 9450 | if (scopeBindingInfo.removeWatches) { |
| 9451 | isolateScope.$on('$destroy', scopeBindingInfo.removeWatches); |
| 9452 | } |
| 9453 | } |
| 9454 | |
| 9455 | // Initialize bindToController bindings |
| 9456 | for (var name in elementControllers) { |
| 9457 | var controllerDirective = controllerDirectives[name]; |
| 9458 | var controller = elementControllers[name]; |
| 9459 | var bindings = controllerDirective.$$bindings.bindToController; |
| 9460 | |
| 9461 | if (preAssignBindingsEnabled) { |
| 9462 | if (bindings) { |
| 9463 | controller.bindingInfo = |
no test coverage detected