### File

`src/app/app.module.ts`

### Declarations

- AppComponent

### Providers

- AuthGuard

### Imports

- AppRoutingModule

### Bootstrap

- AppComponent

    import { NgModule } from '@angular/core';
    import { FormsModule, ReactiveFormsModule } from '@angular/forms';
    import { Http, HttpModule } from '@angular/http';
    import { HttpClientModule } from '@angular/common/http';
    import { BrowserModule } from '@angular/platform-browser';
    import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
    import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
    import { TranslateHttpLoader } from '@ngx-translate/http-loader';
    import { AppRoutingModule } from './app-routing.module';
    import { AppComponent } from './app.component';
    import { AuthGuard } from './shared';

    // AoT requires an exported function for factories
    export function HttpLoaderFactory(http: Http) {
        // for development
        // return new TranslateHttpLoader(http, '/assets/i18n/', '.json');
        return new TranslateHttpLoader(http, '/assets/i18n/', '.json');
    }
    @NgModule({
        declarations: [
            AppComponent
        ],
        imports: [
            BrowserModule,
            BrowserAnimationsModule,
            HttpClientModule,
            FormsModule,
            HttpModule,
            AppRoutingModule,
            TranslateModule.forRoot({
                loader: {
                    provide: TranslateLoader,
                    useFactory: HttpLoaderFactory,
                    deps: [Http]
                }
            })
        ],
        providers: [AuthGuard],
        bootstrap: [AppComponent]
    })
    export class AppModule {
    }

# results matching ""

# No results matching ""