(directive, directiveName)
| 7291 | } |
| 7292 | |
| 7293 | function parseDirectiveBindings(directive, directiveName) { |
| 7294 | var bindings = { |
| 7295 | isolateScope: null, |
| 7296 | bindToController: null |
| 7297 | }; |
| 7298 | if (isObject(directive.scope)) { |
| 7299 | if (directive.bindToController === true) { |
| 7300 | bindings.bindToController = parseIsolateBindings(directive.scope, |
| 7301 | directiveName, true); |
| 7302 | bindings.isolateScope = {}; |
| 7303 | } else { |
| 7304 | bindings.isolateScope = parseIsolateBindings(directive.scope, |
| 7305 | directiveName, false); |
| 7306 | } |
| 7307 | } |
| 7308 | if (isObject(directive.bindToController)) { |
| 7309 | bindings.bindToController = |
| 7310 | parseIsolateBindings(directive.bindToController, directiveName, true); |
| 7311 | } |
| 7312 | if (isObject(bindings.bindToController)) { |
| 7313 | var controller = directive.controller; |
| 7314 | var controllerAs = directive.controllerAs; |
| 7315 | if (!controller) { |
| 7316 | // There is no controller, there may or may not be a controllerAs property |
| 7317 | throw $compileMinErr('noctrl', |
| 7318 | "Cannot bind to controller without directive '{0}'s controller.", |
| 7319 | directiveName); |
| 7320 | } else if (!identifierForController(controller, controllerAs)) { |
| 7321 | // There is a controller, but no identifier or controllerAs property |
| 7322 | throw $compileMinErr('noident', |
| 7323 | "Cannot bind to controller without identifier for directive '{0}'.", |
| 7324 | directiveName); |
| 7325 | } |
| 7326 | } |
| 7327 | return bindings; |
| 7328 | } |
| 7329 | |
| 7330 | function assertValidDirectiveName(name) { |
| 7331 | var letter = name.charAt(0); |
no test coverage detected