* 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)
| 10229 | * @returns {boolean} true if directive was added. |
| 10230 | */ |
| 10231 | function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName, |
| 10232 | endAttrName) { |
| 10233 | if (name === ignoreDirective) return null; |
| 10234 | var match = null; |
| 10235 | if (hasDirectives.hasOwnProperty(name)) { |
| 10236 | for (var directive, directives = $injector.get(name + Suffix), |
| 10237 | i = 0, ii = directives.length; i < ii; i++) { |
| 10238 | directive = directives[i]; |
| 10239 | if ((isUndefined(maxPriority) || maxPriority > directive.priority) && |
| 10240 | directive.restrict.indexOf(location) !== -1) { |
| 10241 | if (startAttrName) { |
| 10242 | directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName}); |
| 10243 | } |
| 10244 | if (!directive.$$bindings) { |
| 10245 | var bindings = directive.$$bindings = |
| 10246 | parseDirectiveBindings(directive, directive.name); |
| 10247 | if (isObject(bindings.isolateScope)) { |
| 10248 | directive.$$isolateBindings = bindings.isolateScope; |
| 10249 | } |
| 10250 | } |
| 10251 | tDirectives.push(directive); |
| 10252 | match = directive; |
| 10253 | } |
| 10254 | } |
| 10255 | } |
| 10256 | return match; |
| 10257 | } |
| 10258 | |
| 10259 | |
| 10260 | /** |
no test coverage detected