Thanks for your fast response.
Now my login.module.ts looks like this:
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { LoginPage } from './login';
import { TranslateModule} from "@ngx-translate/core";
@NgModule({
declarations: [
LoginPage,
],
imports: [
IonicPageModule.forChild(LoginPage),
TranslateModule.forChild()
],
})
export class LoginPageModule {
constructor(public translatemodule: TranslateModule){
}
}
But now, I get this error:
Error: Uncaught (in promise): TypeError: Object(…) is not a function
TypeError: Object(…) is not a function
edit:
also changed the login.module.ts to
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { LoginPage } from './login';
import {HttpClient, HttpClientModule} from "@angular/common/http";
import {TranslateLoader, TranslateModule} from "@ngx-translate/core";
import {TranslateHttpLoader} from "@ngx-translate/http-loader";
@NgModule({
declarations: [
LoginPage,
],
imports: [
IonicPageModule.forChild(LoginPage),
HttpClientModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: (HttpLoaderFactory),
deps: [HttpClient]
}
}),
],
})
export class LoginPageModule {
}
export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}
But now I get this error:
Error: Module build failed: Error: ENOENT: no such file or directory, open ‘C:\Users\Robert Notebook\Dropbox\Prillan_gesamt\node_modules@ngx-translate\http-loader\esm5\ngx-translate-http-loader.js’
And additionaly this one:
Argument of type ‘HttpClient’ is not assignable to parameter of type ‘Http’. Property ‘_backend’ is missing in type ‘HttpClient’.
in
export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}
Which import should I use and how to deal with the problem occuring??