MCPcopy Create free account
hub / github.com/apache/cloudstack / addDirective

Function addDirective

tools/ngui/static/js/lib/angular.js:4430–4446  ·  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)

Source from the content-addressed store, hash-verified

4428 * @returns true if directive was added.
4429 */
4430 function addDirective(tDirectives, name, location, maxPriority) {
4431 var match = false;
4432 if (hasDirectives.hasOwnProperty(name)) {
4433 for(var directive, directives = $injector.get(name + Suffix),
4434 i = 0, ii = directives.length; i<ii; i++) {
4435 try {
4436 directive = directives[i];
4437 if ( (maxPriority === undefined || maxPriority > directive.priority) &&
4438 directive.restrict.indexOf(location) != -1) {
4439 tDirectives.push(directive);
4440 match = true;
4441 }
4442 } catch(e) { $exceptionHandler(e); }
4443 }
4444 }
4445 return match;
4446 }
4447
4448
4449 /**

Callers 1

collectDirectivesFunction · 0.85

Calls 1

getMethod · 0.65

Tested by

no test coverage detected