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

Function parseIsolateBindings

test/angular/1.3/angular.js:6495–6519  ·  view source on GitHub ↗
(scope, directiveName)

Source from the content-addressed store, hash-verified

6493 var EVENT_HANDLER_ATTR_REGEXP = /^(on[a-z]+|formaction)$/;
6494
6495 function parseIsolateBindings(scope, directiveName) {
6496 var LOCAL_REGEXP = /^\s*([@&]|=(\*?))(\??)\s*(\w*)\s*$/;
6497
6498 var bindings = {};
6499
6500 forEach(scope, function(definition, scopeName) {
6501 var match = definition.match(LOCAL_REGEXP);
6502
6503 if (!match) {
6504 throw $compileMinErr('iscp',
6505 "Invalid isolate scope definition for directive '{0}'." +
6506 " Definition: {... {1}: '{2}' ...}",
6507 directiveName, scopeName, definition);
6508 }
6509
6510 bindings[scopeName] = {
6511 mode: match[1][0],
6512 collection: match[2] === '*',
6513 optional: match[3] === '?',
6514 attrName: match[4] || scopeName
6515 };
6516 });
6517
6518 return bindings;
6519 }
6520
6521 /**
6522 * @ngdoc method

Callers 1

$CompileProviderFunction · 0.70

Calls 2

matchMethod · 0.80
forEachFunction · 0.70

Tested by

no test coverage detected