(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn)
| 9924 | } |
| 9925 | |
| 9926 | function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) { |
| 9927 | var i, ii, linkFn, isolateScope, controllerScope, elementControllers, transcludeFn, $element, |
| 9928 | attrs, scopeBindingInfo; |
| 9929 | |
| 9930 | if (compileNode === linkNode) { |
| 9931 | attrs = templateAttrs; |
| 9932 | $element = templateAttrs.$$element; |
| 9933 | } else { |
| 9934 | $element = jqLite(linkNode); |
| 9935 | attrs = new Attributes($element, templateAttrs); |
| 9936 | } |
| 9937 | |
| 9938 | controllerScope = scope; |
| 9939 | if (newIsolateScopeDirective) { |
| 9940 | isolateScope = scope.$new(true); |
| 9941 | } else if (newScopeDirective) { |
| 9942 | controllerScope = scope.$parent; |
| 9943 | } |
| 9944 | |
| 9945 | if (boundTranscludeFn) { |
| 9946 | // track `boundTranscludeFn` so it can be unwrapped if `transcludeFn` |
| 9947 | // is later passed as `parentBoundTranscludeFn` to `publicLinkFn` |
| 9948 | transcludeFn = controllersBoundTransclude; |
| 9949 | transcludeFn.$$boundTransclude = boundTranscludeFn; |
| 9950 | // expose the slots on the `$transclude` function |
| 9951 | transcludeFn.isSlotFilled = function(slotName) { |
| 9952 | return !!boundTranscludeFn.$$slots[slotName]; |
| 9953 | }; |
| 9954 | } |
| 9955 | |
| 9956 | if (controllerDirectives) { |
| 9957 | elementControllers = setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope, newIsolateScopeDirective); |
| 9958 | } |
| 9959 | |
| 9960 | if (newIsolateScopeDirective) { |
| 9961 | // Initialize isolate scope bindings for new isolate scope directive. |
| 9962 | compile.$$addScopeInfo($element, isolateScope, true, !(templateDirective && (templateDirective === newIsolateScopeDirective || |
| 9963 | templateDirective === newIsolateScopeDirective.$$originalDirective))); |
| 9964 | compile.$$addScopeClass($element, true); |
| 9965 | isolateScope.$$isolateBindings = |
| 9966 | newIsolateScopeDirective.$$isolateBindings; |
| 9967 | scopeBindingInfo = initializeDirectiveBindings(scope, attrs, isolateScope, |
| 9968 | isolateScope.$$isolateBindings, |
| 9969 | newIsolateScopeDirective); |
| 9970 | if (scopeBindingInfo.removeWatches) { |
| 9971 | isolateScope.$on('$destroy', scopeBindingInfo.removeWatches); |
| 9972 | } |
| 9973 | } |
| 9974 | |
| 9975 | // Initialize bindToController bindings |
| 9976 | for (var name in elementControllers) { |
| 9977 | var controllerDirective = controllerDirectives[name]; |
| 9978 | var controller = elementControllers[name]; |
| 9979 | var bindings = controllerDirective.$$bindings.bindToController; |
| 9980 | |
| 9981 | if (preAssignBindingsEnabled) { |
| 9982 | if (bindings) { |
| 9983 | controller.bindingInfo = |
no test coverage detected