MCPcopy Index your code
hub / github.com/angular-ui/ui-grid / applyDirectivesToNode

Function applyDirectivesToNode

lib/test/angular/1.6.7/angular.js:9523–10054  ·  view source on GitHub ↗

* Once the directives have been collected, their compile functions are executed. This method * is responsible for inlining directive templates as well as terminating the application * of the directives if the terminal directive has been reached. * * @param {Array} directives Arra

(directives, compileNode, templateAttrs, transcludeFn,
                                   jqCollection, originalReplaceDirective, preLinkFns, postLinkFns,
                                   previousCompileContext)

Source from the content-addressed store, hash-verified

9521 * @returns {Function} linkFn
9522 */
9523 function applyDirectivesToNode(directives, compileNode, templateAttrs, transcludeFn,
9524 jqCollection, originalReplaceDirective, preLinkFns, postLinkFns,
9525 previousCompileContext) {
9526 previousCompileContext = previousCompileContext || {};
9527
9528 var terminalPriority = -Number.MAX_VALUE,
9529 newScopeDirective = previousCompileContext.newScopeDirective,
9530 controllerDirectives = previousCompileContext.controllerDirectives,
9531 newIsolateScopeDirective = previousCompileContext.newIsolateScopeDirective,
9532 templateDirective = previousCompileContext.templateDirective,
9533 nonTlbTranscludeDirective = previousCompileContext.nonTlbTranscludeDirective,
9534 hasTranscludeDirective = false,
9535 hasTemplate = false,
9536 hasElementTranscludeDirective = previousCompileContext.hasElementTranscludeDirective,
9537 $compileNode = templateAttrs.$$element = jqLite(compileNode),
9538 directive,
9539 directiveName,
9540 $template,
9541 replaceDirective = originalReplaceDirective,
9542 childTranscludeFn = transcludeFn,
9543 linkFn,
9544 didScanForMultipleTransclusion = false,
9545 mightHaveMultipleTransclusionError = false,
9546 directiveValue;
9547
9548 // executes all directives on the current element
9549 for (var i = 0, ii = directives.length; i < ii; i++) {
9550 directive = directives[i];
9551 var attrStart = directive.$$start;
9552 var attrEnd = directive.$$end;
9553
9554 // collect multiblock sections
9555 if (attrStart) {
9556 $compileNode = groupScan(compileNode, attrStart, attrEnd);
9557 }
9558 $template = undefined;
9559
9560 if (terminalPriority > directive.priority) {
9561 break; // prevent further processing of directives
9562 }
9563
9564 directiveValue = directive.scope;
9565
9566 if (directiveValue) {
9567
9568 // skip the check for directives with async templates, we'll check the derived sync
9569 // directive when the template arrives
9570 if (!directive.templateUrl) {
9571 if (isObject(directiveValue)) {
9572 // This directive is trying to add an isolated scope.
9573 // Check that there is no scope of any kind already
9574 assertNoDuplicate('new/isolated scope', newIsolateScopeDirective || newScopeDirective,
9575 directive, $compileNode);
9576 newIsolateScopeDirective = directive;
9577 } else {
9578 // This directive is trying to add a child scope.
9579 // Check that there is no isolated scope already
9580 assertNoDuplicate('new/isolated scope', newIsolateScopeDirective, directive,

Callers 2

compileNodesFunction · 0.70
compileTemplateUrlFunction · 0.70

Calls 15

groupScanFunction · 0.70
isObjectFunction · 0.70
assertNoDuplicateFunction · 0.70
createMapFunction · 0.70
replaceWithFunction · 0.70
sliceArgsFunction · 0.70
compilationGeneratorFunction · 0.70
jqLiteCloneFunction · 0.70
forEachFunction · 0.70
directiveNormalizeFunction · 0.70
nodeName_Function · 0.70
isFunctionFunction · 0.70

Tested by

no test coverage detected