(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn)
| 10528 | } |
| 10529 | |
| 10530 | function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) { |
| 10531 | var i, ii, linkFn, isolateScope, controllerScope, elementControllers, transcludeFn, $element, |
| 10532 | attrs, scopeBindingInfo; |
| 10533 | |
| 10534 | if (compileNode === linkNode) { |
| 10535 | attrs = templateAttrs; |
| 10536 | $element = templateAttrs.$$element; |
| 10537 | } else { |
| 10538 | $element = jqLite(linkNode); |
| 10539 | attrs = new Attributes($element, templateAttrs); |
| 10540 | } |
| 10541 | |
| 10542 | controllerScope = scope; |
| 10543 | if (newIsolateScopeDirective) { |
| 10544 | isolateScope = scope.$new(true); |
| 10545 | } else if (newScopeDirective) { |
| 10546 | controllerScope = scope.$parent; |
| 10547 | } |
| 10548 | |
| 10549 | if (boundTranscludeFn) { |
| 10550 | // track `boundTranscludeFn` so it can be unwrapped if `transcludeFn` |
| 10551 | // is later passed as `parentBoundTranscludeFn` to `publicLinkFn` |
| 10552 | transcludeFn = controllersBoundTransclude; |
| 10553 | transcludeFn.$$boundTransclude = boundTranscludeFn; |
| 10554 | // expose the slots on the `$transclude` function |
| 10555 | transcludeFn.isSlotFilled = function(slotName) { |
| 10556 | return !!boundTranscludeFn.$$slots[slotName]; |
| 10557 | }; |
| 10558 | } |
| 10559 | |
| 10560 | if (controllerDirectives) { |
| 10561 | elementControllers = setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope, newIsolateScopeDirective); |
| 10562 | } |
| 10563 | |
| 10564 | if (newIsolateScopeDirective) { |
| 10565 | // Initialize isolate scope bindings for new isolate scope directive. |
| 10566 | compile.$$addScopeInfo($element, isolateScope, true, !(templateDirective && (templateDirective === newIsolateScopeDirective || |
| 10567 | templateDirective === newIsolateScopeDirective.$$originalDirective))); |
| 10568 | compile.$$addScopeClass($element, true); |
| 10569 | isolateScope.$$isolateBindings = |
| 10570 | newIsolateScopeDirective.$$isolateBindings; |
| 10571 | scopeBindingInfo = initializeDirectiveBindings(scope, attrs, isolateScope, |
| 10572 | isolateScope.$$isolateBindings, |
| 10573 | newIsolateScopeDirective); |
| 10574 | if (scopeBindingInfo.removeWatches) { |
| 10575 | isolateScope.$on('$destroy', scopeBindingInfo.removeWatches); |
| 10576 | } |
| 10577 | } |
| 10578 | |
| 10579 | // Initialize bindToController bindings |
| 10580 | for (var name in elementControllers) { |
| 10581 | var controllerDirective = controllerDirectives[name]; |
| 10582 | var controller = elementControllers[name]; |
| 10583 | var bindings = controllerDirective.$$bindings.bindToController; |
| 10584 | |
| 10585 | controller.instance = controller(); |
| 10586 | $element.data('$' + controllerDirective.name + 'Controller', controller.instance); |
| 10587 | controller.bindingInfo = |
no test coverage detected