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

Function parseIsolateBindings

lib/test/angular/1.7.0/angular.js:8268–8303  ·  view source on GitHub ↗
(scope, directiveName, isController)

Source from the content-addressed store, hash-verified

8266 var bindingCache = createMap();
8267
8268 function parseIsolateBindings(scope, directiveName, isController) {
8269 var LOCAL_REGEXP = /^([@&<]|=(\*?))(\??)\s*([\w$]*)$/;
8270
8271 var bindings = createMap();
8272
8273 forEach(scope, function(definition, scopeName) {
8274 definition = definition.trim();
8275
8276 if (definition in bindingCache) {
8277 bindings[scopeName] = bindingCache[definition];
8278 return;
8279 }
8280 var match = definition.match(LOCAL_REGEXP);
8281
8282 if (!match) {
8283 throw $compileMinErr('iscp',
8284 'Invalid {3} for directive \'{0}\'.' +
8285 ' Definition: {... {1}: \'{2}\' ...}',
8286 directiveName, scopeName, definition,
8287 (isController ? 'controller bindings definition' :
8288 'isolate scope definition'));
8289 }
8290
8291 bindings[scopeName] = {
8292 mode: match[1][0],
8293 collection: match[2] === '*',
8294 optional: match[3] === '?',
8295 attrName: match[4] || scopeName
8296 };
8297 if (match[4]) {
8298 bindingCache[definition] = bindings[scopeName];
8299 }
8300 });
8301
8302 return bindings;
8303 }
8304
8305 function parseDirectiveBindings(directive, directiveName) {
8306 var bindings = {

Callers 1

parseDirectiveBindingsFunction · 0.70

Calls 2

createMapFunction · 0.70
forEachFunction · 0.70

Tested by

no test coverage detected