Open yunusemreuveyik opened 4 years ago
please someone help!!!
I am having the exact same issue
hi, per https://www.npmjs.com/package/@ngx-translate/core on angular 9 you need "@ngx-translate/core": "12.0.0", "@ngx-translate/http-loader": "5.0.0"
I fixed like this:
create a shared.module.ts
and write your code like this:
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ToolbarCustomComponent } from './directives/toolbar-custom/toolbar-custom.component';
import { TranslateModule } from '@ngx-translate/core';
@NgModule({
imports: [
CommonModule,
TranslateModule
],
declarations: [
ToolbarCustomComponent //your component that you wanna use ngx translate in
],
exports: [
ToolbarCustomComponent //your component that you wanna use ngx translate in
]
})
export class SharedModule {}
ı have working ngx translation in my project, it works perfectly in all my components which have a module.ts that ı could import my translateModule into imports, but in my directive I only have html, component.ts and css, so ı tried to import my translation module in the component.ts like below:
but ı get this error: Error: The pipe 'translate' could not be found!
I call this custom directive in my all other components like:
<app-toolbar-custom></app-toolbar-custom>
But why I cant make my directive recognize my translation?
in my custom toolbar directive html:
my app.module:
my versions: