* 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)
| 8201 | * @returns {boolean} true if directive was added. |
| 8202 | */ |
| 8203 | function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName, |
| 8204 | endAttrName) { |
| 8205 | if (name === ignoreDirective) return null; |
| 8206 | var match = null; |
| 8207 | if (hasDirectives.hasOwnProperty(name)) { |
| 8208 | for (var directive, directives = $injector.get(name + Suffix), |
| 8209 | i = 0, ii = directives.length; i < ii; i++) { |
| 8210 | try { |
| 8211 | directive = directives[i]; |
| 8212 | if ((maxPriority === undefined || maxPriority > directive.priority) && |
| 8213 | directive.restrict.indexOf(location) != -1) { |
| 8214 | if (startAttrName) { |
| 8215 | directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName}); |
| 8216 | } |
| 8217 | tDirectives.push(directive); |
| 8218 | match = directive; |
| 8219 | } |
| 8220 | } catch (e) { $exceptionHandler(e); } |
| 8221 | } |
| 8222 | } |
| 8223 | return match; |
| 8224 | } |
| 8225 | |
| 8226 | |
| 8227 | /** |
no test coverage detected