(directive, directiveName)
| 7782 | } |
| 7783 | |
| 7784 | function parseDirectiveBindings(directive, directiveName) { |
| 7785 | var bindings = { |
| 7786 | isolateScope: null, |
| 7787 | bindToController: null |
| 7788 | }; |
| 7789 | if (isObject(directive.scope)) { |
| 7790 | if (directive.bindToController === true) { |
| 7791 | bindings.bindToController = parseIsolateBindings(directive.scope, |
| 7792 | directiveName, true); |
| 7793 | bindings.isolateScope = {}; |
| 7794 | } else { |
| 7795 | bindings.isolateScope = parseIsolateBindings(directive.scope, |
| 7796 | directiveName, false); |
| 7797 | } |
| 7798 | } |
| 7799 | if (isObject(directive.bindToController)) { |
| 7800 | bindings.bindToController = |
| 7801 | parseIsolateBindings(directive.bindToController, directiveName, true); |
| 7802 | } |
| 7803 | if (bindings.bindToController && !directive.controller) { |
| 7804 | // There is no controller |
| 7805 | throw $compileMinErr('noctrl', |
| 7806 | 'Cannot bind to controller without directive \'{0}\'s controller.', |
| 7807 | directiveName); |
| 7808 | } |
| 7809 | return bindings; |
| 7810 | } |
| 7811 | |
| 7812 | function assertValidDirectiveName(name) { |
| 7813 | var letter = name.charAt(0); |
no test coverage detected