MCPcopy
hub / github.com/angular-ui/ui-grid / addDirective

Function addDirective

lib/test/angular/1.6.7/angular.js:10154–10180  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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 /**

Callers 2

collectDirectivesFunction · 0.70
collectCommentDirectivesFunction · 0.70

Calls 4

isUndefinedFunction · 0.70
inheritFunction · 0.70
parseDirectiveBindingsFunction · 0.70
isObjectFunction · 0.70

Tested by

no test coverage detected