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

Function addDirective

test/angular/1.5/angular.js:9705–9731  ·  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

9703 * @returns {boolean} true if directive was added.
9704 */
9705 function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName,
9706 endAttrName) {
9707 if (name === ignoreDirective) return null;
9708 var match = null;
9709 if (hasDirectives.hasOwnProperty(name)) {
9710 for (var directive, directives = $injector.get(name + Suffix),
9711 i = 0, ii = directives.length; i < ii; i++) {
9712 directive = directives[i];
9713 if ((isUndefined(maxPriority) || maxPriority > directive.priority) &&
9714 directive.restrict.indexOf(location) !== -1) {
9715 if (startAttrName) {
9716 directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName});
9717 }
9718 if (!directive.$$bindings) {
9719 var bindings = directive.$$bindings =
9720 parseDirectiveBindings(directive, directive.name);
9721 if (isObject(bindings.isolateScope)) {
9722 directive.$$isolateBindings = bindings.isolateScope;
9723 }
9724 }
9725 tDirectives.push(directive);
9726 match = directive;
9727 }
9728 }
9729 }
9730 return match;
9731 }
9732
9733
9734 /**

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