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

Function parseDirectiveBindings

test/angular/1.6/angular.js:8241–8267  ·  view source on GitHub ↗
(directive, directiveName)

Source from the content-addressed store, hash-verified

8239 }
8240
8241 function parseDirectiveBindings(directive, directiveName) {
8242 var bindings = {
8243 isolateScope: null,
8244 bindToController: null
8245 };
8246 if (isObject(directive.scope)) {
8247 if (directive.bindToController === true) {
8248 bindings.bindToController = parseIsolateBindings(directive.scope,
8249 directiveName, true);
8250 bindings.isolateScope = {};
8251 } else {
8252 bindings.isolateScope = parseIsolateBindings(directive.scope,
8253 directiveName, false);
8254 }
8255 }
8256 if (isObject(directive.bindToController)) {
8257 bindings.bindToController =
8258 parseIsolateBindings(directive.bindToController, directiveName, true);
8259 }
8260 if (bindings.bindToController && !directive.controller) {
8261 // There is no controller
8262 throw $compileMinErr('noctrl',
8263 'Cannot bind to controller without directive \'{0}\'s controller.',
8264 directiveName);
8265 }
8266 return bindings;
8267 }
8268
8269 function assertValidDirectiveName(name) {
8270 var letter = name.charAt(0);

Callers 1

addDirectiveFunction · 0.70

Calls 2

isObjectFunction · 0.70
parseIsolateBindingsFunction · 0.70

Tested by

no test coverage detected