Estoy con un servicio de traducción para Angular 6. Todo funciona correctamente hasta que intento traduccir el header o el sidebar, que entonces me da este error.
Error: Template parse errors:
The pipe 'translate' could not be found ("="false"> <i class="mdi mdi-calendar-blank"></i><span class="hide-menu">{{ [ERROR ->]'menuAgenda' | translate }}
</span>
</a>
"): ng:///SharedModule/SidebarComponent.html@23:89
El contenido de las páginas las tengo en un PagesModule.
import { BrowserModule } from '@angular/platform-browser';
import { NgModule, APP_INITIALIZER } from '@angular/core';
import { PAGES_ROUTES } from './pages.routes';
import { HttpClientModule } from '@angular/common/http';
import { SharedModule } from '../pages/shared/shared.module';
import { PagesComponent } from './pages.component';
import { DashboardComponent } from './dashboard/dashboard.component';
import { ProgressComponent } from './progress/progress.component';
import { Graficas1Component } from './graficas1/graficas1.component';
import { SolicitudComprasComponent } from './solicitud-compras/solicitud-compras.component';
import { SolicitudEquipoClinicaComponent } from './solicitud-equipo-clinica/solicitud-equipo-clinica.component';
import { ReunionPeriodicaComponent } from './reunion-periodica/reunion-periodica.component';
import { RevisionSalarialComponent } from './revision-salarial/revision-salarial.component';
import { EvaluacionDesempenoComponent } from './evaluacion-desempeno/evaluacion-desempeno.component';
import { TranslateService } from '../translate.service';
import { TranslatePipe } from '../translate.pipe';
export function setupTranslateFactory(
service: TranslateService): Function {
return () => service.use('es');
}
@NgModule({
declarations: [
PagesComponent,
TranslatePipe,
DashboardComponent,
ProgressComponent,
Graficas1Component,
SolicitudComprasComponent,
SolicitudEquipoClinicaComponent,
ReunionPeriodicaComponent,
RevisionSalarialComponent,
EvaluacionDesempenoComponent
],
exports: [
PagesComponent,
DashboardComponent,
ProgressComponent,
Graficas1Component,
TranslatePipe
],
imports: [
BrowserModule,
SharedModule,
HttpClientModule,
PAGES_ROUTES
],
providers: [
TranslateService,
{
provide: APP_INITIALIZER,
useFactory: setupTranslateFactory,
deps: [
TranslateService
],
multi: true
}
]
})
export class PagesModules {}
Y en shared.module.ts tengo esto:
import { NgModule } from '@angular/core';
import { NopagefoundComponent } from './nopagefound/nopagefound.component';
import { HeaderComponent } from './header/header.component';
import { SidebarComponent } from './sidebar/sidebar.component';
import { BreadcrumbsComponent } from './breadcrumbs/breadcrumbs.component';
@NgModule({
declarations: [
NopagefoundComponent,
HeaderComponent,
SidebarComponent,
BreadcrumbsComponent ],
exports: [
NopagefoundComponent,
HeaderComponent,
SidebarComponent,
BreadcrumbsComponent,
],
providers: []
})
export class SharedModule { }
alguién tiene idea porque pasa esto??
Un saludo