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

Function addDirective

test/angular/1.3/angular.js:7844–7865  ·  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

7842 * @returns {boolean} true if directive was added.
7843 */
7844 function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName,
7845 endAttrName) {
7846 if (name === ignoreDirective) return null;
7847 var match = null;
7848 if (hasDirectives.hasOwnProperty(name)) {
7849 for (var directive, directives = $injector.get(name + Suffix),
7850 i = 0, ii = directives.length; i < ii; i++) {
7851 try {
7852 directive = directives[i];
7853 if ((maxPriority === undefined || maxPriority > directive.priority) &&
7854 directive.restrict.indexOf(location) != -1) {
7855 if (startAttrName) {
7856 directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName});
7857 }
7858 tDirectives.push(directive);
7859 match = directive;
7860 }
7861 } catch (e) { $exceptionHandler(e); }
7862 }
7863 }
7864 return match;
7865 }
7866
7867
7868 /**

Callers 1

collectDirectivesFunction · 0.70

Calls 1

inheritFunction · 0.70

Tested by

no test coverage detected