app.module.ts 1.42 KB
Newer Older
Vitali Stupin's avatar
Vitali Stupin committed
1
2
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
Vitali Stupin's avatar
Vitali Stupin committed
3
import { FormsModule } from '@angular/forms';
Vitali Stupin's avatar
Vitali Stupin committed
4
5
6
import {TranslateLoader, TranslateModule} from '@ngx-translate/core';
import {TranslateHttpLoader} from '@ngx-translate/http-loader';
import {HttpClient, HttpClientModule} from '@angular/common/http';
Vitali Stupin's avatar
Initial    
Vitali Stupin committed
7

Vitali Stupin's avatar
Vitali Stupin committed
8
import { AppComponent } from './app.component';
9
import { SubsystemListComponent } from './subsystem-list/subsystem-list.component';
10
import { SearchComponent } from './subsystem-list/search/search.component';
11
import { SubsystemItemComponent } from './subsystem-list/subsystem-item/subsystem-item.component';
12
13
import { AppRoutingModule } from './app-routing.module';
import { SubsystemComponent } from './subsystem/subsystem.component';
Vitali Stupin's avatar
Vitali Stupin committed
14
import { HeaderComponent } from './header/header.component';
Vitali Stupin's avatar
Vitali Stupin committed
15
16
17

@NgModule({
  declarations: [
Vitali Stupin's avatar
Initial    
Vitali Stupin committed
18
    AppComponent,
19
    SubsystemListComponent,
Vitali Stupin's avatar
Initial    
Vitali Stupin committed
20
    SearchComponent,
21
    SubsystemItemComponent,
Vitali Stupin's avatar
Vitali Stupin committed
22
23
    SubsystemComponent,
    HeaderComponent
Vitali Stupin's avatar
Vitali Stupin committed
24
25
  ],
  imports: [
Vitali Stupin's avatar
Initial    
Vitali Stupin committed
26
    BrowserModule,
Vitali Stupin's avatar
Vitali Stupin committed
27
    HttpClientModule,
28
    FormsModule,
Vitali Stupin's avatar
Vitali Stupin committed
29
30
31
32
33
34
35
36
    AppRoutingModule,
    TranslateModule.forRoot({
      loader: {
        provide: TranslateLoader,
        useFactory: HttpLoaderFactory,
        deps: [HttpClient]
      }
    })
Vitali Stupin's avatar
Vitali Stupin committed
37
38
39
40
41
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
Vitali Stupin's avatar
Vitali Stupin committed
42
43
44
45

export function HttpLoaderFactory(http: HttpClient) {
  return new TranslateHttpLoader(http);
}