MCPcopy Create free account
hub / github.com/OpenReservation/OpenReservation / addDirective

Function addDirective

OpenReservation/wwwroot/Scripts/angular.js:9255–9287  ·  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

(tDirectives,
                    name,
                    location,
                    maxPriority,
                    ignoreDirective,
                    startAttrName,
                    endAttrName)

Source from the content-addressed store, hash-verified

9253 * @returns {boolean} true if directive was added.
9254 */
9255 function addDirective(tDirectives,
9256 name,
9257 location,
9258 maxPriority,
9259 ignoreDirective,
9260 startAttrName,
9261 endAttrName) {
9262 if (name === ignoreDirective) return null;
9263 var match = null;
9264 if (hasDirectives.hasOwnProperty(name)) {
9265 for (var directive,
9266 directives = $injector.get(name + Suffix),
9267 i = 0,
9268 ii = directives.length;
9269 i < ii;
9270 i++) {
9271 try {
9272 directive = directives[i];
9273 if ((isUndefined(maxPriority) || maxPriority > directive.priority) &&
9274 directive.restrict.indexOf(location) != -1) {
9275 if (startAttrName) {
9276 directive = inherit(directive, { $$start: startAttrName, $$end: endAttrName });
9277 }
9278 tDirectives.push(directive);
9279 match = directive;
9280 }
9281 } catch (e) {
9282 $exceptionHandler(e);
9283 }
9284 }
9285 }
9286 return match;
9287 }
9288
9289 /**
9290 * looks up the directive and returns true if it is a multi-element directive,

Callers 1

collectDirectivesFunction · 0.85

Calls 2

isUndefinedFunction · 0.85
inheritFunction · 0.85

Tested by

no test coverage detected