I'm having some troubles integrating the ng2-translate in angular 2 RC5 for other components different than the main app.
I want to use the pipe globally, and in a research i found that probably i need to use a "provider" (but that is on RC4), and then found that i need to use the "declarations". Any ideas?
As always... thanks so much for the help!
When i use in a template file, the:
{{ 'HOME.TITLE' | translate }}
I get this error on the browser:
The pipe 'translate' could not be found ("<h1>title test</h1>
<h2>[ERROR ->]{{ 'HOME.TITLE' | translate }}</h2>
This is my main.ts file:
// The browser platform with a compiler
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
// The app module
import { AppModule } from './app.module';
// Compile and launch the module
platformBrowserDynamic().bootstrapModule(AppModule);
The main module file:
import {TranslateModule, TranslateService} from "ng2-translate/ng2-translate";
@NgModule({
imports: [
BrowserModule,
HttpModule,
RouterModule.forRoot(routes),
AboutModule,
HomeModule,
SharedModule.forRoot(),
TranslateModule.forRoot()
],
declarations: [AppComponent],
providers: [{
provide: APP_BASE_HREF,
useValue: '<%= APP_BASE %>'
}],
bootstrap: [AppComponent]
})
export class AppModule { }