($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope)
| 8834 | } |
| 8835 | |
| 8836 | function setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope) { |
| 8837 | var elementControllers = createMap(); |
| 8838 | for (var controllerKey in controllerDirectives) { |
| 8839 | var directive = controllerDirectives[controllerKey]; |
| 8840 | var locals = { |
| 8841 | $scope: directive === newIsolateScopeDirective || directive.$$isolateScope ? isolateScope : scope, |
| 8842 | $element: $element, |
| 8843 | $attrs: attrs, |
| 8844 | $transclude: transcludeFn |
| 8845 | }; |
| 8846 | |
| 8847 | var controller = directive.controller; |
| 8848 | if (controller == '@') { |
| 8849 | controller = attrs[directive.name]; |
| 8850 | } |
| 8851 | |
| 8852 | var controllerInstance = $controller(controller, locals, true, directive.controllerAs); |
| 8853 | |
| 8854 | // For directives with element transclusion the element is a comment, |
| 8855 | // but jQuery .data doesn't support attaching data to comment nodes as it's hard to |
| 8856 | // clean up (http://bugs.jquery.com/ticket/8335). |
| 8857 | // Instead, we save the controllers for the element in a local hash and attach to .data |
| 8858 | // later, once we have the actual element. |
| 8859 | elementControllers[directive.name] = controllerInstance; |
| 8860 | if (!hasElementTranscludeDirective) { |
| 8861 | $element.data('$' + directive.name + 'Controller', controllerInstance.instance); |
| 8862 | } |
| 8863 | } |
| 8864 | return elementControllers; |
| 8865 | } |
| 8866 | |
| 8867 | function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) { |
| 8868 | var i, ii, linkFn, isolateScope, controllerScope, elementControllers, transcludeFn, $element, |
no test coverage detected