填寫這份《一分鐘調查》,幫我們(開發組)做得更好!去填寫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.