(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn,
thisLinkFn)
| 8189 | } |
| 8190 | |
| 8191 | function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn, |
| 8192 | thisLinkFn) { |
| 8193 | var i, ii, linkFn, controller, isolateScope, elementControllers, transcludeFn, $element, |
| 8194 | attrs; |
| 8195 | |
| 8196 | if (compileNode === linkNode) { |
| 8197 | attrs = templateAttrs; |
| 8198 | $element = templateAttrs.$$element; |
| 8199 | } else { |
| 8200 | $element = jqLite(linkNode); |
| 8201 | attrs = new Attributes($element, templateAttrs); |
| 8202 | } |
| 8203 | |
| 8204 | if (newIsolateScopeDirective) { |
| 8205 | isolateScope = scope.$new(true); |
| 8206 | } |
| 8207 | |
| 8208 | if (boundTranscludeFn) { |
| 8209 | // track `boundTranscludeFn` so it can be unwrapped if `transcludeFn` |
| 8210 | // is later passed as `parentBoundTranscludeFn` to `publicLinkFn` |
| 8211 | transcludeFn = controllersBoundTransclude; |
| 8212 | transcludeFn.$$boundTransclude = boundTranscludeFn; |
| 8213 | } |
| 8214 | |
| 8215 | if (controllerDirectives) { |
| 8216 | elementControllers = setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope); |
| 8217 | } |
| 8218 | |
| 8219 | if (newIsolateScopeDirective) { |
| 8220 | // Initialize isolate scope bindings for new isolate scope directive. |
| 8221 | compile.$$addScopeInfo($element, isolateScope, true, !(templateDirective && (templateDirective === newIsolateScopeDirective || |
| 8222 | templateDirective === newIsolateScopeDirective.$$originalDirective))); |
| 8223 | compile.$$addScopeClass($element, true); |
| 8224 | isolateScope.$$isolateBindings = |
| 8225 | newIsolateScopeDirective.$$isolateBindings; |
| 8226 | initializeDirectiveBindings(scope, attrs, isolateScope, |
| 8227 | isolateScope.$$isolateBindings, |
| 8228 | newIsolateScopeDirective, isolateScope); |
| 8229 | } |
| 8230 | if (elementControllers) { |
| 8231 | // Initialize bindToController bindings for new/isolate scopes |
| 8232 | var scopeDirective = newIsolateScopeDirective || newScopeDirective; |
| 8233 | var bindings; |
| 8234 | var controllerForBindings; |
| 8235 | if (scopeDirective && elementControllers[scopeDirective.name]) { |
| 8236 | bindings = scopeDirective.$$bindings.bindToController; |
| 8237 | controller = elementControllers[scopeDirective.name]; |
| 8238 | |
| 8239 | if (controller && controller.identifier && bindings) { |
| 8240 | controllerForBindings = controller; |
| 8241 | thisLinkFn.$$destroyBindings = |
| 8242 | initializeDirectiveBindings(scope, attrs, controller.instance, |
| 8243 | bindings, scopeDirective); |
| 8244 | } |
| 8245 | } |
| 8246 | for (i in elementControllers) { |
| 8247 | controller = elementControllers[i]; |
| 8248 | var controllerResult = controller(); |
no test coverage detected