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

Function setupControllers

test/angular/1.6/angular.js:10171–10197  ·  view source on GitHub ↗
($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope, newIsolateScopeDirective)

Source from the content-addressed store, hash-verified

10169 }
10170
10171 function setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope, newIsolateScopeDirective) {
10172 var elementControllers = createMap();
10173 for (var controllerKey in controllerDirectives) {
10174 var directive = controllerDirectives[controllerKey];
10175 var locals = {
10176 $scope: directive === newIsolateScopeDirective || directive.$$isolateScope ? isolateScope : scope,
10177 $element: $element,
10178 $attrs: attrs,
10179 $transclude: transcludeFn
10180 };
10181
10182 var controller = directive.controller;
10183 if (controller === '@') {
10184 controller = attrs[directive.name];
10185 }
10186
10187 var controllerInstance = $controller(controller, locals, true, directive.controllerAs);
10188
10189 // For directives with element transclusion the element is a comment.
10190 // In this case .data will not attach any data.
10191 // Instead, we save the controllers for the element in a local hash and attach to .data
10192 // later, once we have the actual element.
10193 elementControllers[directive.name] = controllerInstance;
10194 $element.data('$' + directive.name + 'Controller', controllerInstance.instance);
10195 }
10196 return elementControllers;
10197 }
10198
10199 // Depending upon the context in which a directive finds itself it might need to have a new isolated
10200 // or child scope created. For instance:

Callers 1

nodeLinkFnFunction · 0.70

Calls 1

createMapFunction · 0.70

Tested by

no test coverage detected