MCPcopy
hub / github.com/angular-ui/ui-router / compilationGenerator

Function compilationGenerator

test/angular/1.7/angular.js:10100–10116  ·  view source on GitHub ↗

* A function generator that is used to support both eager and lazy compilation * linking function. * @param eager * @param $compileNodes * @param transcludeFn * @param maxPriority * @param ignoreDirective * @param previousCompileContext * @returns {Function}

(eager, $compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext)

Source from the content-addressed store, hash-verified

10098 * @returns {Function}
10099 */
10100 function compilationGenerator(eager, $compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext) {
10101 var compiled;
10102
10103 if (eager) {
10104 return compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext);
10105 }
10106 return /** @this */ function lazyCompilation() {
10107 if (!compiled) {
10108 compiled = compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext);
10109
10110 // Null out all of these references in order to make them eligible for garbage collection
10111 // since this is a potentially long lived closure
10112 $compileNodes = transcludeFn = previousCompileContext = null;
10113 }
10114 return compiled.apply(this, arguments);
10115 };
10116 }
10117
10118 /**
10119 * Once the directives have been collected, their compile functions are executed. This method

Callers 1

applyDirectivesToNodeFunction · 0.70

Calls 1

compileFunction · 0.70

Tested by

no test coverage detected