* 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)
| 7757 | * @returns {boolean} true if directive was added. |
| 7758 | */ |
| 7759 | function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName, |
| 7760 | endAttrName) { |
| 7761 | if (name === ignoreDirective) return null; |
| 7762 | var match = null; |
| 7763 | if (hasDirectives.hasOwnProperty(name)) { |
| 7764 | for (var directive, directives = $injector.get(name + Suffix), |
| 7765 | i = 0, ii = directives.length; i < ii; i++) { |
| 7766 | try { |
| 7767 | directive = directives[i]; |
| 7768 | if ((maxPriority === undefined || maxPriority > directive.priority) && |
| 7769 | directive.restrict.indexOf(location) != -1) { |
| 7770 | if (startAttrName) { |
| 7771 | directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName}); |
| 7772 | } |
| 7773 | tDirectives.push(directive); |
| 7774 | match = directive; |
| 7775 | } |
| 7776 | } catch (e) { $exceptionHandler(e); } |
| 7777 | } |
| 7778 | } |
| 7779 | return match; |
| 7780 | } |
| 7781 | |
| 7782 | |
| 7783 | /** |
no test coverage detected