* 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)
| 9050 | * @returns {boolean} true if directive was added. |
| 9051 | */ |
| 9052 | function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName, |
| 9053 | endAttrName) { |
| 9054 | if (name === ignoreDirective) return null; |
| 9055 | var match = null; |
| 9056 | if (hasDirectives.hasOwnProperty(name)) { |
| 9057 | for (var directive, directives = $injector.get(name + Suffix), |
| 9058 | i = 0, ii = directives.length; i < ii; i++) { |
| 9059 | try { |
| 9060 | directive = directives[i]; |
| 9061 | if ((isUndefined(maxPriority) || maxPriority > directive.priority) && |
| 9062 | directive.restrict.indexOf(location) != -1) { |
| 9063 | if (startAttrName) { |
| 9064 | directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName}); |
| 9065 | } |
| 9066 | tDirectives.push(directive); |
| 9067 | match = directive; |
| 9068 | } |
| 9069 | } catch (e) { $exceptionHandler(e); } |
| 9070 | } |
| 9071 | } |
| 9072 | return match; |
| 9073 | } |
| 9074 | |
| 9075 | |
| 9076 | /** |
no test coverage detected