* 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)
| 10152 | * @returns {boolean} true if directive was added. |
| 10153 | */ |
| 10154 | function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName, |
| 10155 | endAttrName) { |
| 10156 | if (name === ignoreDirective) return null; |
| 10157 | var match = null; |
| 10158 | if (hasDirectives.hasOwnProperty(name)) { |
| 10159 | for (var directive, directives = $injector.get(name + Suffix), |
| 10160 | i = 0, ii = directives.length; i < ii; i++) { |
| 10161 | directive = directives[i]; |
| 10162 | if ((isUndefined(maxPriority) || maxPriority > directive.priority) && |
| 10163 | directive.restrict.indexOf(location) !== -1) { |
| 10164 | if (startAttrName) { |
| 10165 | directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName}); |
| 10166 | } |
| 10167 | if (!directive.$$bindings) { |
| 10168 | var bindings = directive.$$bindings = |
| 10169 | parseDirectiveBindings(directive, directive.name); |
| 10170 | if (isObject(bindings.isolateScope)) { |
| 10171 | directive.$$isolateBindings = bindings.isolateScope; |
| 10172 | } |
| 10173 | } |
| 10174 | tDirectives.push(directive); |
| 10175 | match = directive; |
| 10176 | } |
| 10177 | } |
| 10178 | } |
| 10179 | return match; |
| 10180 | } |
| 10181 | |
| 10182 | |
| 10183 | /** |
no test coverage detected