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

Function parseDirectiveBindings

lib/test/angular/1.5.0/angular.js:7399–7434  ·  view source on GitHub ↗
(directive, directiveName)

Source from the content-addressed store, hash-verified

7397 }
7398
7399 function parseDirectiveBindings(directive, directiveName) {
7400 var bindings = {
7401 isolateScope: null,
7402 bindToController: null
7403 };
7404 if (isObject(directive.scope)) {
7405 if (directive.bindToController === true) {
7406 bindings.bindToController = parseIsolateBindings(directive.scope,
7407 directiveName, true);
7408 bindings.isolateScope = {};
7409 } else {
7410 bindings.isolateScope = parseIsolateBindings(directive.scope,
7411 directiveName, false);
7412 }
7413 }
7414 if (isObject(directive.bindToController)) {
7415 bindings.bindToController =
7416 parseIsolateBindings(directive.bindToController, directiveName, true);
7417 }
7418 if (isObject(bindings.bindToController)) {
7419 var controller = directive.controller;
7420 var controllerAs = directive.controllerAs;
7421 if (!controller) {
7422 // There is no controller, there may or may not be a controllerAs property
7423 throw $compileMinErr('noctrl',
7424 "Cannot bind to controller without directive '{0}'s controller.",
7425 directiveName);
7426 } else if (!identifierForController(controller, controllerAs)) {
7427 // There is a controller, but no identifier or controllerAs property
7428 throw $compileMinErr('noident',
7429 "Cannot bind to controller without identifier for directive '{0}'.",
7430 directiveName);
7431 }
7432 }
7433 return bindings;
7434 }
7435
7436 function assertValidDirectiveName(name) {
7437 var letter = name.charAt(0);

Callers 1

$CompileProviderFunction · 0.70

Calls 3

isObjectFunction · 0.70
parseIsolateBindingsFunction · 0.70
identifierForControllerFunction · 0.70

Tested by

no test coverage detected