(directive, directiveName)
| 8751 | } |
| 8752 | |
| 8753 | function parseDirectiveBindings(directive, directiveName) { |
| 8754 | var bindings = { |
| 8755 | isolateScope: null, |
| 8756 | bindToController: null |
| 8757 | }; |
| 8758 | if (isObject(directive.scope)) { |
| 8759 | if (directive.bindToController === true) { |
| 8760 | bindings.bindToController = parseIsolateBindings(directive.scope, |
| 8761 | directiveName, true); |
| 8762 | bindings.isolateScope = {}; |
| 8763 | } else { |
| 8764 | bindings.isolateScope = parseIsolateBindings(directive.scope, |
| 8765 | directiveName, false); |
| 8766 | } |
| 8767 | } |
| 8768 | if (isObject(directive.bindToController)) { |
| 8769 | bindings.bindToController = |
| 8770 | parseIsolateBindings(directive.bindToController, directiveName, true); |
| 8771 | } |
| 8772 | if (bindings.bindToController && !directive.controller) { |
| 8773 | // There is no controller |
| 8774 | throw $compileMinErr('noctrl', |
| 8775 | 'Cannot bind to controller without directive \'{0}\'s controller.', |
| 8776 | directiveName); |
| 8777 | } |
| 8778 | return bindings; |
| 8779 | } |
| 8780 | |
| 8781 | function assertValidDirectiveName(name) { |
| 8782 | var letter = name.charAt(0); |
no test coverage detected