Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49229

TranslateHttpLoader Problem

$
0
0

@Deviljin wrote:

Hi, I just made my way through several guides and docs, and still it doesnt work at all…

Can’t resolve all parameters for TranslateHttpLoader(?,?,?)

Here my Code:
.
.
.
import { HttpModule, Http } from ‘@angular/http’;
import { TranslateModule, TranslateLoader } from ‘@ngx-translate/core’;
import { TranslateHttpLoader } from ‘@ngx-translate/http-loader’;

import { MyApp } from ‘./app.component’;
import { HomePage } from ‘…/pages/home/home’;

export function createTranslateLoader(http: Http) {
return new TranslateHttpLoader(http, ‘./assets/i18n/’, ‘.json’);
}

@NgModule({
declarations: [
MyApp,
HomePage
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp),
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: (createTranslateLoader),
deps: [Http]
}
})
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage
],
providers: [
StatusBar,
SplashScreen,
Http,
TranslateHttpLoader,
HttpModule,
{ provide: ErrorHandler, useClass: IonicErrorHandler }
]
})

export class AppModule { }

i dont get the problem, contructor of translateHttpLoader looks good for me.

Hope u guys can help me out :slight_smile:
thank you

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49229

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>