app.module.ts 1.52 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
Vitali Stupin committed
7
import { AppComponent } from './app.component';
8
import { SubsystemListComponent } from './subsystem-list/subsystem-list.component';
9
import { SearchComponent } from './subsystem-list/search/search.component';
10
import { SubsystemItemComponent } from './subsystem-list/subsystem-item/subsystem-item.component';
11
12
import { AppRoutingModule } from './app-routing.module';
import { SubsystemComponent } from './subsystem/subsystem.component';
Vitali Stupin's avatar
Vitali Stupin committed
13
import { HeaderComponent } from './header/header.component';
Vitali Stupin's avatar
Vitali Stupin committed
14
15
16

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

export function HttpLoaderFactory(http: HttpClient) {
Vitali Stupin's avatar
Vitali Stupin committed
43
44
  // Providing path as a workaround for ngx-translate bug with --base-href option
  return new TranslateHttpLoader(http, './assets/i18n/');
Vitali Stupin's avatar
Vitali Stupin committed
45
}