Skip to content
Snippets Groups Projects
app.module.ts 2.24 KiB
Newer Older
/*
 * Copyright (C) 2021 Associated Universities, Inc. Washington DC, USA.
 *
 * This file is part of NRAO Workspaces.
 *
 * Workspaces is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Workspaces is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Workspaces.  If not, see <https://www.gnu.org/licenses/>.
 */
import {BrowserModule, Title} from "@angular/platform-browser";
import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
import {ReactiveFormsModule} from "@angular/forms";
import {APP_INITIALIZER, NgModule} from "@angular/core";
import {HttpClientModule} from "@angular/common/http";
import {AppComponent} from "./app.component";
import {NgbModule} from "@ng-bootstrap/ng-bootstrap";
import {WebAnalyticsService} from "./web-analytics/web-analytics.service";
import {HeaderComponent} from "./header/header.component";
import {FooterComponent} from "./footer/footer.component";
import {AppRoutingModule} from "./app-routing.module";
import {SplashComponent} from "./splash/splash.component";
import {SharedModule} from "./shared/shared.module";
import {AlertComponent} from "./shared/alert/alert.component";
import {TestDataService} from "./shared/test-data.service";

export function initializeApp(testDataService: TestDataService) {
  return (): Promise<any> => { return testDataService.Init(); }
}
  declarations: [AppComponent, HeaderComponent, FooterComponent, SplashComponent, AlertComponent],
  entryComponents: [],
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    ReactiveFormsModule,
    NgbModule,
    AppRoutingModule,
    HttpClientModule,
  providers: [WebAnalyticsService, {provide: APP_INITIALIZER, useFactory: initializeApp, deps: [TestDataService], multi: true}, Title],
  bootstrap: [AppComponent],
export class AppModule {}