(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn,
thisLinkFn)
| 8050 | } |
| 8051 | |
| 8052 | function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn, |
| 8053 | thisLinkFn) { |
| 8054 | var i, ii, linkFn, controller, isolateScope, elementControllers, transcludeFn, $element, |
| 8055 | attrs; |
| 8056 | |
| 8057 | if (compileNode === linkNode) { |
| 8058 | attrs = templateAttrs; |
| 8059 | $element = templateAttrs.$$element; |
| 8060 | } else { |
| 8061 | $element = jqLite(linkNode); |
| 8062 | attrs = new Attributes($element, templateAttrs); |
| 8063 | } |
| 8064 | |
| 8065 | if (newIsolateScopeDirective) { |
| 8066 | isolateScope = scope.$new(true); |
| 8067 | } |
| 8068 | |
| 8069 | if (boundTranscludeFn) { |
| 8070 | // track `boundTranscludeFn` so it can be unwrapped if `transcludeFn` |
| 8071 | // is later passed as `parentBoundTranscludeFn` to `publicLinkFn` |
| 8072 | transcludeFn = controllersBoundTransclude; |
| 8073 | transcludeFn.$$boundTransclude = boundTranscludeFn; |
| 8074 | } |
| 8075 | |
| 8076 | if (controllerDirectives) { |
| 8077 | elementControllers = setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope); |
| 8078 | } |
| 8079 | |
| 8080 | if (newIsolateScopeDirective) { |
| 8081 | // Initialize isolate scope bindings for new isolate scope directive. |
| 8082 | compile.$$addScopeInfo($element, isolateScope, true, !(templateDirective && (templateDirective === newIsolateScopeDirective || |
| 8083 | templateDirective === newIsolateScopeDirective.$$originalDirective))); |
| 8084 | compile.$$addScopeClass($element, true); |
| 8085 | isolateScope.$$isolateBindings = |
| 8086 | newIsolateScopeDirective.$$isolateBindings; |
| 8087 | initializeDirectiveBindings(scope, attrs, isolateScope, |
| 8088 | isolateScope.$$isolateBindings, |
| 8089 | newIsolateScopeDirective, isolateScope); |
| 8090 | } |
| 8091 | if (elementControllers) { |
| 8092 | // Initialize bindToController bindings for new/isolate scopes |
| 8093 | var scopeDirective = newIsolateScopeDirective || newScopeDirective; |
| 8094 | var bindings; |
| 8095 | var controllerForBindings; |
| 8096 | if (scopeDirective && elementControllers[scopeDirective.name]) { |
| 8097 | bindings = scopeDirective.$$bindings.bindToController; |
| 8098 | controller = elementControllers[scopeDirective.name]; |
| 8099 | |
| 8100 | if (controller && controller.identifier && bindings) { |
| 8101 | controllerForBindings = controller; |
| 8102 | thisLinkFn.$$destroyBindings = |
| 8103 | initializeDirectiveBindings(scope, attrs, controller.instance, |
| 8104 | bindings, scopeDirective); |
| 8105 | } |
| 8106 | } |
| 8107 | for (i in elementControllers) { |
| 8108 | controller = elementControllers[i]; |
| 8109 | var controllerResult = controller(); |
no test coverage detected