app.module.ts 3.03 KB
Newer Older
cazenave's avatar
cazenave committed
1
import { BrowserModule } from '@angular/platform-browser';
cazenave's avatar
cazenave committed
2
import { NgModule, APP_INITIALIZER } from '@angular/core';
cazenave's avatar
cazenave committed
3
4
5
6
7
8
9
10
11
12


import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { LoginComponent } from './login/login.component';
import { MatMenuModule } from '@angular/material/menu';
import { MatDividerModule } from '@angular/material/divider';
import { MatCardModule } from '@angular/material/card';
import { MatInputModule } from '@angular/material/input';
cazenave's avatar
cazenave committed
13
14
import { MatDialogModule } from '@angular/material/dialog';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
cazenave's avatar
cazenave committed
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

import { RepositoryComponent } from './repository/repository.component';
import { AccessapiComponent } from './accessapi/accessapi.component';
import { DatasetsComponent } from './datasets/datasets.component';
import { OntologieComponent } from './ontologie/ontologie.component';
import { PublishComponent } from './publish/publish.component';
import { SettingfdpComponent } from './settingfdp/settingfdp.component';
import { SettingsmartapiComponent } from './settingsmartapi/settingsmartapi.component';
import { UserComponent } from './user/user.component';

import { ReactiveFormsModule } from '@angular/forms';
import {FormsModule} from '@angular/forms';

import { RepositoryinfoComponent } from './repositoryinfo/repositoryinfo.component';

cazenave's avatar
cazenave committed
30
import { HttpClientModule, HttpClient } from '@angular/common/http';
cazenave's avatar
cazenave committed
31
import { FileSaverModule } from 'ngx-filesaver';
cazenave's avatar
cazenave committed
32
import { SwaggereditorComponent } from './swaggereditor/swaggereditor.component';
cazenave's avatar
cazenave committed
33
34
import { AppConfiguration } from './AppConfiguration';
import { ElasticsearchComponent } from './elasticsearch/elasticsearch.component';
Administrator's avatar
Administrator committed
35
36
import { PublishapiComponent } from './publishapi/publishapi.component';
import { SearchComponent } from './search/search.component'
37
import { ParseXmlService } from './services/parse-xml.service';
cazenave's avatar
cazenave committed
38
39


cazenave's avatar
cazenave committed
40
41
42
43
44
45
46
47
48
49
50
51
52

@NgModule({
  declarations: [
    AppComponent,
    LoginComponent,
    RepositoryComponent,
    AccessapiComponent,
    DatasetsComponent,
    OntologieComponent,
    PublishComponent,
    SettingfdpComponent,
    SettingsmartapiComponent,
    UserComponent,
cazenave's avatar
cazenave committed
53
    RepositoryinfoComponent,
cazenave's avatar
cazenave committed
54
55
    SwaggereditorComponent,
    ElasticsearchComponent,
Administrator's avatar
Administrator committed
56
57
    PublishapiComponent,
    SearchComponent
cazenave's avatar
cazenave committed
58
    ],
cazenave's avatar
cazenave committed
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
  imports: [
    BrowserModule,
    AppRoutingModule,
    BrowserAnimationsModule,
    MatMenuModule,
    MatDividerModule,
    MatCardModule,
    MatInputModule,
    MatDialogModule,
    MatProgressSpinnerModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    FileSaverModule

  ],
cazenave's avatar
cazenave committed
75
76
  providers: [
    AppConfiguration,
77
    ParseXmlService,
cazenave's avatar
cazenave committed
78
79
80
81
82
    { 
        provide: APP_INITIALIZER, 
        useFactory: AppConfigurationFactory, 
        deps: [AppConfiguration, HttpClient], multi: true },
  ],
cazenave's avatar
cazenave committed
83
84
85
  bootstrap: [AppComponent]
})
export class AppModule { }
cazenave's avatar
cazenave committed
86
87
88
89

export function AppConfigurationFactory(appConfig: AppConfiguration) {
    return () => appConfig.ensureInit();
  }