填写这份《一分钟调查》,帮我们(开发组)做得更好!去填写Home

NG0302: Pipe not found!
没有找到此管道!

说明

Description

Angular 找不到具有此名称的管道。模板中引用的管道未正确命名或声明。管道必须在使用它的 NgModule 中声明或导入,并且模板中使用的名称必须与管道装饰器中定义的名称相匹配。

Angular can't find a pipe with this name. The pipe referenced in the template has not been named or declared properly. A pipe must be either declared or imported in the NgModule where it is used, and the name used in a template must match the name defined in the pipe decorator.


如何排除本错误

Debugging the error

使用管道名来跟踪声明和使用了此管道的模板或模块。

Use the pipe name to trace the templates or modules where this pipe is declared and used.

要解决此错误,请确保:

To resolve this error, ensure that:

  • 本地自定义管道在管道的装饰器中具有唯一的名称,并在 NgModule 声明,或

    A local custom pipe is uniquely named in the pipe's decorator, and declared in the NgModule, or

  • 来自另一个 NgModule 的管道已添加到使用它的 NgModule 的导入表 imports 中。

    A pipe from another NgModule is added to the imports of the NgModule where it is used.

如果你最近添加了导入或声明,则可能需要重新启动服务器以查看这些更改。

If you recently added an import or declaration, you may need to restart your server to see these changes.