MCPcopy Index your code
hub / github.com/angular/angular / compileNgModule

Function compileNgModule

packages/core/src/render3/jit/module.ts:105–117  ·  view source on GitHub ↗
(moduleType: Type<any>, ngModule: NgModule = {})

Source from the content-addressed store, hash-verified

103 * This function automatically gets called when a class has a `@NgModule` decorator.
104 */
105export function compileNgModule(moduleType: Type<any>, ngModule: NgModule = {}): void {
106 patchModuleCompilation();
107 compileNgModuleDefs(moduleType as NgModuleType, ngModule);
108 if (ngModule.id !== undefined) {
109 registerNgModuleType(moduleType as NgModuleType, ngModule.id);
110 }
111
112 // Because we don't know if all declarations have resolved yet at the moment the
113 // NgModule decorator is executing, we're enqueueing the setting of module scope
114 // on its declarations to be run at a later time when all declarations for the module,
115 // including forward refs, have resolved.
116 enqueueModuleForDelayedScoping(moduleType, ngModule);
117}
118
119/**
120 * Compiles and adds the `ɵmod`, `ɵfac` and `ɵinj` properties to the module class.

Callers 1

ng_module.tsFile · 0.90

Calls 4

patchModuleCompilationFunction · 0.90
registerNgModuleTypeFunction · 0.90
compileNgModuleDefsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…