* 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, ignoreDirective, startAttrName,
endAttrName)
| 8340 | * @returns {boolean} true if directive was added. |
| 8341 | */ |
| 8342 | function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName, |
| 8343 | endAttrName) { |
| 8344 | if (name === ignoreDirective) return null; |
| 8345 | var match = null; |
| 8346 | if (hasDirectives.hasOwnProperty(name)) { |
| 8347 | for (var directive, directives = $injector.get(name + Suffix), |
| 8348 | i = 0, ii = directives.length; i < ii; i++) { |
| 8349 | try { |
| 8350 | directive = directives[i]; |
| 8351 | if ((isUndefined(maxPriority) || maxPriority > directive.priority) && |
| 8352 | directive.restrict.indexOf(location) != -1) { |
| 8353 | if (startAttrName) { |
| 8354 | directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName}); |
| 8355 | } |
| 8356 | tDirectives.push(directive); |
| 8357 | match = directive; |
| 8358 | } |
| 8359 | } catch (e) { $exceptionHandler(e); } |
| 8360 | } |
| 8361 | } |
| 8362 | return match; |
| 8363 | } |
| 8364 | |
| 8365 | |
| 8366 | /** |
no test coverage detected