MCPcopy
hub / github.com/angular-ui/ui-grid / addDirective

Function addDirective

lib/test/angular/1.8.0/angular.js:10814–10840  ·  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

10812 * @returns {boolean} true if directive was added.
10813 */
10814 function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName,
10815 endAttrName) {
10816 if (name === ignoreDirective) return null;
10817 var match = null;
10818 if (hasDirectives.hasOwnProperty(name)) {
10819 for (var directive, directives = $injector.get(name + Suffix),
10820 i = 0, ii = directives.length; i < ii; i++) {
10821 directive = directives[i];
10822 if ((isUndefined(maxPriority) || maxPriority > directive.priority) &&
10823 directive.restrict.indexOf(location) !== -1) {
10824 if (startAttrName) {
10825 directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName});
10826 }
10827 if (!directive.$$bindings) {
10828 var bindings = directive.$$bindings =
10829 parseDirectiveBindings(directive, directive.name);
10830 if (isObject(bindings.isolateScope)) {
10831 directive.$$isolateBindings = bindings.isolateScope;
10832 }
10833 }
10834 tDirectives.push(directive);
10835 match = directive;
10836 }
10837 }
10838 }
10839 return match;
10840 }
10841
10842
10843 /**

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