* 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)
| 7842 | * @returns {boolean} true if directive was added. |
| 7843 | */ |
| 7844 | function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName, |
| 7845 | endAttrName) { |
| 7846 | if (name === ignoreDirective) return null; |
| 7847 | var match = null; |
| 7848 | if (hasDirectives.hasOwnProperty(name)) { |
| 7849 | for (var directive, directives = $injector.get(name + Suffix), |
| 7850 | i = 0, ii = directives.length; i < ii; i++) { |
| 7851 | try { |
| 7852 | directive = directives[i]; |
| 7853 | if ((maxPriority === undefined || maxPriority > directive.priority) && |
| 7854 | directive.restrict.indexOf(location) != -1) { |
| 7855 | if (startAttrName) { |
| 7856 | directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName}); |
| 7857 | } |
| 7858 | tDirectives.push(directive); |
| 7859 | match = directive; |
| 7860 | } |
| 7861 | } catch (e) { $exceptionHandler(e); } |
| 7862 | } |
| 7863 | } |
| 7864 | return match; |
| 7865 | } |
| 7866 | |
| 7867 | |
| 7868 | /** |
no test coverage detected