MCPcopy
hub / github.com/angular-ui/ui-grid / parseIsolateBindings

Function parseIsolateBindings

lib/test/angular/1.4.3/angular.js:6837–6863  ·  view source on GitHub ↗
(scope, directiveName, isController)

Source from the content-addressed store, hash-verified

6835 var EVENT_HANDLER_ATTR_REGEXP = /^(on[a-z]+|formaction)$/;
6836
6837 function parseIsolateBindings(scope, directiveName, isController) {
6838 var LOCAL_REGEXP = /^\s*([@&]|=(\*?))(\??)\s*(\w*)\s*$/;
6839
6840 var bindings = {};
6841
6842 forEach(scope, function(definition, scopeName) {
6843 var match = definition.match(LOCAL_REGEXP);
6844
6845 if (!match) {
6846 throw $compileMinErr('iscp',
6847 "Invalid {3} for directive '{0}'." +
6848 " Definition: {... {1}: '{2}' ...}",
6849 directiveName, scopeName, definition,
6850 (isController ? "controller bindings definition" :
6851 "isolate scope definition"));
6852 }
6853
6854 bindings[scopeName] = {
6855 mode: match[1][0],
6856 collection: match[2] === '*',
6857 optional: match[3] === '?',
6858 attrName: match[4] || scopeName
6859 };
6860 });
6861
6862 return bindings;
6863 }
6864
6865 function parseDirectiveBindings(directive, directiveName) {
6866 var bindings = {

Callers 1

parseDirectiveBindingsFunction · 0.70

Calls 1

forEachFunction · 0.70

Tested by

no test coverage detected