管道在子模块中不起作用

huangapple go评论81阅读模式
英文:

Translate pipe is not working in child module

问题

我正在使用Angular 8开发一个示例应用程序。除了使用ngx-translate进行翻译。我已经在app.module.ts中导入了所有必需的代码来实现翻译服务,并且它完美运行。但是,当我添加一个新的模块进行延迟加载并尝试在这个新创建的模块中访问翻译管道时,它给我报错:

找不到管道 'translate'

有人可以帮忙吗?

英文:

I am developing a sample app using Angular 8. Along with ngx-translate for translation.
I have imported all the required code in app.module.ts for translate service and it worked perfectly fine. As soon as i added a new module for lazy loading and trying to access the translate pipe in this newly created module, it is giving me error
>The pipe 'translate' could not be found

Can anyone please help?

答案1

得分: 0

Importing TranslateModule in child module's module.ts worked.
Thanks guys.

英文:

Importing TranslateModule in child module's module.ts worked.
Thanks guys.

huangapple
  • 本文由 发表于 2020年1月3日 23:29:47
  • 转载请务必保留本文链接:https://go.coder-hub.com/59581211.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定