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

Function addDirective

test/angular/1.6/angular.js:10225–10251  ·  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

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

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