MCPcopy
hub / github.com/angular-ui/ui-router / parseDirectiveBindings

Function parseDirectiveBindings

test/angular/1.7/angular.js:8688–8714  ·  view source on GitHub ↗
(directive, directiveName)

Source from the content-addressed store, hash-verified

8686 }
8687
8688 function parseDirectiveBindings(directive, directiveName) {
8689 var bindings = {
8690 isolateScope: null,
8691 bindToController: null
8692 };
8693 if (isObject(directive.scope)) {
8694 if (directive.bindToController === true) {
8695 bindings.bindToController = parseIsolateBindings(directive.scope,
8696 directiveName, true);
8697 bindings.isolateScope = {};
8698 } else {
8699 bindings.isolateScope = parseIsolateBindings(directive.scope,
8700 directiveName, false);
8701 }
8702 }
8703 if (isObject(directive.bindToController)) {
8704 bindings.bindToController =
8705 parseIsolateBindings(directive.bindToController, directiveName, true);
8706 }
8707 if (bindings.bindToController && !directive.controller) {
8708 // There is no controller
8709 throw $compileMinErr('noctrl',
8710 'Cannot bind to controller without directive \'{0}\'s controller.',
8711 directiveName);
8712 }
8713 return bindings;
8714 }
8715
8716 function assertValidDirectiveName(name) {
8717 var letter = name.charAt(0);

Callers 1

addDirectiveFunction · 0.70

Calls 2

isObjectFunction · 0.70
parseIsolateBindingsFunction · 0.70

Tested by

no test coverage detected