* looks up the directive and decorates it with exception handling and proper parameters. We * call this the boundDirective. * * @param {string} name name of the directive to look up. * @param {string} location The directive must be found in specific format. * String contai
(tDirectives, name, location, maxPriority)
| 4428 | * @returns true if directive was added. |
| 4429 | */ |
| 4430 | function addDirective(tDirectives, name, location, maxPriority) { |
| 4431 | var match = false; |
| 4432 | if (hasDirectives.hasOwnProperty(name)) { |
| 4433 | for(var directive, directives = $injector.get(name + Suffix), |
| 4434 | i = 0, ii = directives.length; i<ii; i++) { |
| 4435 | try { |
| 4436 | directive = directives[i]; |
| 4437 | if ( (maxPriority === undefined || maxPriority > directive.priority) && |
| 4438 | directive.restrict.indexOf(location) != -1) { |
| 4439 | tDirectives.push(directive); |
| 4440 | match = true; |
| 4441 | } |
| 4442 | } catch(e) { $exceptionHandler(e); } |
| 4443 | } |
| 4444 | } |
| 4445 | return match; |
| 4446 | } |
| 4447 | |
| 4448 | |
| 4449 | /** |
no test coverage detected