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

Function applyDirectivesToNode

test/angular/1.5/angular.js:9074–9605  ·  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

9072 * @returns {Function} linkFn
9073 */
9074 function applyDirectivesToNode(directives, compileNode, templateAttrs, transcludeFn,
9075 jqCollection, originalReplaceDirective, preLinkFns, postLinkFns,
9076 previousCompileContext) {
9077 previousCompileContext = previousCompileContext || {};
9078
9079 var terminalPriority = -Number.MAX_VALUE,
9080 newScopeDirective = previousCompileContext.newScopeDirective,
9081 controllerDirectives = previousCompileContext.controllerDirectives,
9082 newIsolateScopeDirective = previousCompileContext.newIsolateScopeDirective,
9083 templateDirective = previousCompileContext.templateDirective,
9084 nonTlbTranscludeDirective = previousCompileContext.nonTlbTranscludeDirective,
9085 hasTranscludeDirective = false,
9086 hasTemplate = false,
9087 hasElementTranscludeDirective = previousCompileContext.hasElementTranscludeDirective,
9088 $compileNode = templateAttrs.$$element = jqLite(compileNode),
9089 directive,
9090 directiveName,
9091 $template,
9092 replaceDirective = originalReplaceDirective,
9093 childTranscludeFn = transcludeFn,
9094 linkFn,
9095 didScanForMultipleTransclusion = false,
9096 mightHaveMultipleTransclusionError = false,
9097 directiveValue;
9098
9099 // executes all directives on the current element
9100 for (var i = 0, ii = directives.length; i < ii; i++) {
9101 directive = directives[i];
9102 var attrStart = directive.$$start;
9103 var attrEnd = directive.$$end;
9104
9105 // collect multiblock sections
9106 if (attrStart) {
9107 $compileNode = groupScan(compileNode, attrStart, attrEnd);
9108 }
9109 $template = undefined;
9110
9111 if (terminalPriority > directive.priority) {
9112 break; // prevent further processing of directives
9113 }
9114
9115 directiveValue = directive.scope;
9116
9117 if (directiveValue) {
9118
9119 // skip the check for directives with async templates, we'll check the derived sync
9120 // directive when the template arrives
9121 if (!directive.templateUrl) {
9122 if (isObject(directiveValue)) {
9123 // This directive is trying to add an isolated scope.
9124 // Check that there is no scope of any kind already
9125 assertNoDuplicate('new/isolated scope', newIsolateScopeDirective || newScopeDirective,
9126 directive, $compileNode);
9127 newIsolateScopeDirective = directive;
9128 } else {
9129 // This directive is trying to add a child scope.
9130 // Check that there is no isolated scope already
9131 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