Hey, thanks for ya answer.
First of all: is it normal that I have to create the i18n-folder manually or should it be automatically created when installing ngx-translate??
Second:
this is my relevant app.module.ts:
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { HttpModule, Http } from '@angular/http';
export function createTranslateLoader(http: Http) {
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}
@NgModule({
declarations: [
MyApp
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp),
TranslateModule.forRoot(),
HttpModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: (createTranslateLoader),
deps: [Http]
}
})
],
bootstrap: [IonicApp],
entryComponents: [
MyApp
],
providers: [
StatusBar,
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler}
]
})
export class AppModule {
}
When using ionic lab, I get this error:
Typescript Error
Argument of type ‘Http’ is not assignable to parameter of type ‘HttpClient’. Property ‘handler’ is missing in type ‘Http’.
It refers to the function, more specific to the http.
export function createTranslateLoader(http: Http) {
return new TranslateHttpLoader(http, ‘./assets/i18n/’, ‘.json’);
}
Any ideas what might be the reason for this error??