(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn)
| 9853 | } |
| 9854 | |
| 9855 | function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) { |
| 9856 | var i, ii, linkFn, isolateScope, controllerScope, elementControllers, transcludeFn, $element, |
| 9857 | attrs, scopeBindingInfo; |
| 9858 | |
| 9859 | if (compileNode === linkNode) { |
| 9860 | attrs = templateAttrs; |
| 9861 | $element = templateAttrs.$$element; |
| 9862 | } else { |
| 9863 | $element = jqLite(linkNode); |
| 9864 | attrs = new Attributes($element, templateAttrs); |
| 9865 | } |
| 9866 | |
| 9867 | controllerScope = scope; |
| 9868 | if (newIsolateScopeDirective) { |
| 9869 | isolateScope = scope.$new(true); |
| 9870 | } else if (newScopeDirective) { |
| 9871 | controllerScope = scope.$parent; |
| 9872 | } |
| 9873 | |
| 9874 | if (boundTranscludeFn) { |
| 9875 | // track `boundTranscludeFn` so it can be unwrapped if `transcludeFn` |
| 9876 | // is later passed as `parentBoundTranscludeFn` to `publicLinkFn` |
| 9877 | transcludeFn = controllersBoundTransclude; |
| 9878 | transcludeFn.$$boundTransclude = boundTranscludeFn; |
| 9879 | // expose the slots on the `$transclude` function |
| 9880 | transcludeFn.isSlotFilled = function(slotName) { |
| 9881 | return !!boundTranscludeFn.$$slots[slotName]; |
| 9882 | }; |
| 9883 | } |
| 9884 | |
| 9885 | if (controllerDirectives) { |
| 9886 | elementControllers = setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope, newIsolateScopeDirective); |
| 9887 | } |
| 9888 | |
| 9889 | if (newIsolateScopeDirective) { |
| 9890 | // Initialize isolate scope bindings for new isolate scope directive. |
| 9891 | compile.$$addScopeInfo($element, isolateScope, true, !(templateDirective && (templateDirective === newIsolateScopeDirective || |
| 9892 | templateDirective === newIsolateScopeDirective.$$originalDirective))); |
| 9893 | compile.$$addScopeClass($element, true); |
| 9894 | isolateScope.$$isolateBindings = |
| 9895 | newIsolateScopeDirective.$$isolateBindings; |
| 9896 | scopeBindingInfo = initializeDirectiveBindings(scope, attrs, isolateScope, |
| 9897 | isolateScope.$$isolateBindings, |
| 9898 | newIsolateScopeDirective); |
| 9899 | if (scopeBindingInfo.removeWatches) { |
| 9900 | isolateScope.$on('$destroy', scopeBindingInfo.removeWatches); |
| 9901 | } |
| 9902 | } |
| 9903 | |
| 9904 | // Initialize bindToController bindings |
| 9905 | for (var name in elementControllers) { |
| 9906 | var controllerDirective = controllerDirectives[name]; |
| 9907 | var controller = elementControllers[name]; |
| 9908 | var bindings = controllerDirective.$$bindings.bindToController; |
| 9909 | |
| 9910 | if (preAssignBindingsEnabled) { |
| 9911 | if (bindings) { |
| 9912 | controller.bindingInfo = |
no test coverage detected