MCPcopy Index your code
hub / github.com/angular-ui/ui-grid / setupControllers

Function setupControllers

lib/test/angular/1.4.3/angular.js:8021–8050  ·  view source on GitHub ↗
($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope)

Source from the content-addressed store, hash-verified

8019 }
8020
8021 function setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope) {
8022 var elementControllers = createMap();
8023 for (var controllerKey in controllerDirectives) {
8024 var directive = controllerDirectives[controllerKey];
8025 var locals = {
8026 $scope: directive === newIsolateScopeDirective || directive.$$isolateScope ? isolateScope : scope,
8027 $element: $element,
8028 $attrs: attrs,
8029 $transclude: transcludeFn
8030 };
8031
8032 var controller = directive.controller;
8033 if (controller == '@') {
8034 controller = attrs[directive.name];
8035 }
8036
8037 var controllerInstance = $controller(controller, locals, true, directive.controllerAs);
8038
8039 // For directives with element transclusion the element is a comment,
8040 // but jQuery .data doesn't support attaching data to comment nodes as it's hard to
8041 // clean up (http://bugs.jquery.com/ticket/8335).
8042 // Instead, we save the controllers for the element in a local hash and attach to .data
8043 // later, once we have the actual element.
8044 elementControllers[directive.name] = controllerInstance;
8045 if (!hasElementTranscludeDirective) {
8046 $element.data('$' + directive.name + 'Controller', controllerInstance.instance);
8047 }
8048 }
8049 return elementControllers;
8050 }
8051
8052 function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn,
8053 thisLinkFn) {

Callers 1

nodeLinkFnFunction · 0.70

Calls 1

createMapFunction · 0.70

Tested by

no test coverage detected