(directive, directiveName)
| 8686 | } |
| 8687 | |
| 8688 | function parseDirectiveBindings(directive, directiveName) { |
| 8689 | var bindings = { |
| 8690 | isolateScope: null, |
| 8691 | bindToController: null |
| 8692 | }; |
| 8693 | if (isObject(directive.scope)) { |
| 8694 | if (directive.bindToController === true) { |
| 8695 | bindings.bindToController = parseIsolateBindings(directive.scope, |
| 8696 | directiveName, true); |
| 8697 | bindings.isolateScope = {}; |
| 8698 | } else { |
| 8699 | bindings.isolateScope = parseIsolateBindings(directive.scope, |
| 8700 | directiveName, false); |
| 8701 | } |
| 8702 | } |
| 8703 | if (isObject(directive.bindToController)) { |
| 8704 | bindings.bindToController = |
| 8705 | parseIsolateBindings(directive.bindToController, directiveName, true); |
| 8706 | } |
| 8707 | if (bindings.bindToController && !directive.controller) { |
| 8708 | // There is no controller |
| 8709 | throw $compileMinErr('noctrl', |
| 8710 | 'Cannot bind to controller without directive \'{0}\'s controller.', |
| 8711 | directiveName); |
| 8712 | } |
| 8713 | return bindings; |
| 8714 | } |
| 8715 | |
| 8716 | function assertValidDirectiveName(name) { |
| 8717 | var letter = name.charAt(0); |
no test coverage detected