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

Function addDirective

test/angular/1.4/angular.js:8644–8672  ·  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

8642 * @returns {boolean} true if directive was added.
8643 */
8644 function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName,
8645 endAttrName) {
8646 if (name === ignoreDirective) return null;
8647 var match = null;
8648 if (hasDirectives.hasOwnProperty(name)) {
8649 for (var directive, directives = $injector.get(name + Suffix),
8650 i = 0, ii = directives.length; i < ii; i++) {
8651 try {
8652 directive = directives[i];
8653 if ((isUndefined(maxPriority) || maxPriority > directive.priority) &&
8654 directive.restrict.indexOf(location) != -1) {
8655 if (startAttrName) {
8656 directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName});
8657 }
8658 if (!directive.$$bindings) {
8659 var bindings = directive.$$bindings =
8660 parseDirectiveBindings(directive, directive.name);
8661 if (isObject(bindings.isolateScope)) {
8662 directive.$$isolateBindings = bindings.isolateScope;
8663 }
8664 }
8665 tDirectives.push(directive);
8666 match = directive;
8667 }
8668 } catch (e) { $exceptionHandler(e); }
8669 }
8670 }
8671 return match;
8672 }
8673
8674
8675 /**

Callers 1

collectDirectivesFunction · 0.70

Calls 4

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

Tested by

no test coverage detected