(scope, directiveName, isController)
| 7747 | var bindingCache = createMap(); |
| 7748 | |
| 7749 | function parseIsolateBindings(scope, directiveName, isController) { |
| 7750 | var LOCAL_REGEXP = /^\s*([@&<]|=(\*?))(\??)\s*([\w$]*)\s*$/; |
| 7751 | |
| 7752 | var bindings = createMap(); |
| 7753 | |
| 7754 | forEach(scope, function(definition, scopeName) { |
| 7755 | if (definition in bindingCache) { |
| 7756 | bindings[scopeName] = bindingCache[definition]; |
| 7757 | return; |
| 7758 | } |
| 7759 | var match = definition.match(LOCAL_REGEXP); |
| 7760 | |
| 7761 | if (!match) { |
| 7762 | throw $compileMinErr('iscp', |
| 7763 | 'Invalid {3} for directive \'{0}\'.' + |
| 7764 | ' Definition: {... {1}: \'{2}\' ...}', |
| 7765 | directiveName, scopeName, definition, |
| 7766 | (isController ? 'controller bindings definition' : |
| 7767 | 'isolate scope definition')); |
| 7768 | } |
| 7769 | |
| 7770 | bindings[scopeName] = { |
| 7771 | mode: match[1][0], |
| 7772 | collection: match[2] === '*', |
| 7773 | optional: match[3] === '?', |
| 7774 | attrName: match[4] || scopeName |
| 7775 | }; |
| 7776 | if (match[4]) { |
| 7777 | bindingCache[definition] = bindings[scopeName]; |
| 7778 | } |
| 7779 | }); |
| 7780 | |
| 7781 | return bindings; |
| 7782 | } |
| 7783 | |
| 7784 | function parseDirectiveBindings(directive, directiveName) { |
| 7785 | var bindings = { |
no test coverage detected