(directive, directiveName)
| 8303 | } |
| 8304 | |
| 8305 | function parseDirectiveBindings(directive, directiveName) { |
| 8306 | var bindings = { |
| 8307 | isolateScope: null, |
| 8308 | bindToController: null |
| 8309 | }; |
| 8310 | if (isObject(directive.scope)) { |
| 8311 | if (directive.bindToController === true) { |
| 8312 | bindings.bindToController = parseIsolateBindings(directive.scope, |
| 8313 | directiveName, true); |
| 8314 | bindings.isolateScope = {}; |
| 8315 | } else { |
| 8316 | bindings.isolateScope = parseIsolateBindings(directive.scope, |
| 8317 | directiveName, false); |
| 8318 | } |
| 8319 | } |
| 8320 | if (isObject(directive.bindToController)) { |
| 8321 | bindings.bindToController = |
| 8322 | parseIsolateBindings(directive.bindToController, directiveName, true); |
| 8323 | } |
| 8324 | if (bindings.bindToController && !directive.controller) { |
| 8325 | // There is no controller |
| 8326 | throw $compileMinErr('noctrl', |
| 8327 | 'Cannot bind to controller without directive \'{0}\'s controller.', |
| 8328 | directiveName); |
| 8329 | } |
| 8330 | return bindings; |
| 8331 | } |
| 8332 | |
| 8333 | function assertValidDirectiveName(name) { |
| 8334 | var letter = name.charAt(0); |
no test coverage detected