(directive, directiveName)
| 6863 | } |
| 6864 | |
| 6865 | function parseDirectiveBindings(directive, directiveName) { |
| 6866 | var bindings = { |
| 6867 | isolateScope: null, |
| 6868 | bindToController: null |
| 6869 | }; |
| 6870 | if (isObject(directive.scope)) { |
| 6871 | if (directive.bindToController === true) { |
| 6872 | bindings.bindToController = parseIsolateBindings(directive.scope, |
| 6873 | directiveName, true); |
| 6874 | bindings.isolateScope = {}; |
| 6875 | } else { |
| 6876 | bindings.isolateScope = parseIsolateBindings(directive.scope, |
| 6877 | directiveName, false); |
| 6878 | } |
| 6879 | } |
| 6880 | if (isObject(directive.bindToController)) { |
| 6881 | bindings.bindToController = |
| 6882 | parseIsolateBindings(directive.bindToController, directiveName, true); |
| 6883 | } |
| 6884 | if (isObject(bindings.bindToController)) { |
| 6885 | var controller = directive.controller; |
| 6886 | var controllerAs = directive.controllerAs; |
| 6887 | if (!controller) { |
| 6888 | // There is no controller, there may or may not be a controllerAs property |
| 6889 | throw $compileMinErr('noctrl', |
| 6890 | "Cannot bind to controller without directive '{0}'s controller.", |
| 6891 | directiveName); |
| 6892 | } else if (!identifierForController(controller, controllerAs)) { |
| 6893 | // There is a controller, but no identifier or controllerAs property |
| 6894 | throw $compileMinErr('noident', |
| 6895 | "Cannot bind to controller without identifier for directive '{0}'.", |
| 6896 | directiveName); |
| 6897 | } |
| 6898 | } |
| 6899 | return bindings; |
| 6900 | } |
| 6901 | |
| 6902 | function assertValidDirectiveName(name) { |
| 6903 | var letter = name.charAt(0); |
no test coverage detected