mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
21 lines
749 B
TypeScript
21 lines
749 B
TypeScript
import {Compiler, COMPILER_OPTIONS, CompilerFactory, NgModule} from '@angular/core';
|
|
import {BrowserModule} from '@angular/platform-browser';
|
|
import {JitCompilerFactory} from '@angular/platform-browser-dynamic';
|
|
|
|
import {AppComponent} from './app.component';
|
|
|
|
export function createCompiler(compilerFactory: CompilerFactory) {
|
|
return compilerFactory.createCompiler();
|
|
}
|
|
|
|
@NgModule({
|
|
imports: [BrowserModule],
|
|
bootstrap: [AppComponent],
|
|
declarations: [AppComponent],
|
|
providers: [
|
|
{provide: COMPILER_OPTIONS, useValue: {}, multi: true},
|
|
{provide: CompilerFactory, useClass: JitCompilerFactory, deps: [COMPILER_OPTIONS]},
|
|
{provide: Compiler, useFactory: createCompiler, deps: [CompilerFactory]},
|
|
],
|
|
})
|
|
export class AppModule {}
|