You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.4 KiB
45 lines
1.4 KiB
import { APP_INITIALIZER, NgModule } from "@angular/core";
|
|
import { BrowserModule } from "@angular/platform-browser";
|
|
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
|
|
|
|
import { AppComponent } from "./app.component";
|
|
import { FormsModule } from "@angular/forms";
|
|
import { RecordKeyChord } from "./directives/record-key-chord.directive";
|
|
import { PlanDisplayModule } from "./plan-display/plan-display.module";
|
|
import { ConfigService } from "./services/config.service";
|
|
import { ColorPickerComponent } from './color-picker/color-picker.component';
|
|
import { MatButtonModule } from "@angular/material/button";
|
|
import { EditorComponent } from "./editor/editor.component";
|
|
|
|
export function initializeApp(configService: ConfigService) {
|
|
return (): Promise<any> => {
|
|
return configService.init();
|
|
};
|
|
}
|
|
|
|
@NgModule({
|
|
declarations: [
|
|
AppComponent,
|
|
RecordKeyChord, ColorPickerComponent,
|
|
],
|
|
imports: [
|
|
BrowserModule,
|
|
FormsModule,
|
|
PlanDisplayModule,
|
|
MatButtonModule,
|
|
BrowserAnimationsModule,
|
|
EditorComponent,
|
|
],
|
|
providers: [
|
|
{
|
|
// Makes sure we can get the config initialized ASAP as we might need it in lots of places really early.
|
|
provide: APP_INITIALIZER,
|
|
useFactory: initializeApp,
|
|
deps: [ConfigService],
|
|
multi: true
|
|
}
|
|
],
|
|
bootstrap: [AppComponent],
|
|
})
|
|
export class AppModule { }
|