MCPcopy Index your code
hub / github.com/angular-ui/ui-grid / addDirective

Function addDirective

lib/test/angular/1.7.0/angular.js:10231–10257  ·  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

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

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