天天看點

如何處理Angular應用的錯誤消息: No pipe found with name async

錯誤消息:

如何處理Angular應用的錯誤消息: No pipe found with name async

src/app/ngrxdemo/container/component/counter/counter.component.html:8:27 - error NG8004: No pipe found with name ‘async’.

8 目前數:{undefined{ counter$ | async }}

~~~~~

src/app/ngrxdemo/container/component/counter/counter.component.ts:9:16

9 templateUrl: ‘./counter.component.html’,

~~~~~~~~~~~~~~~~~~~~~~~~~~

Error occurs in the template of component CounterComponent.

雖然CounterComponent作為child Component,其parent Component裡已經申明了包含async pipe的Common Module,但是仍然需要在child Component裡也import Common Module:

如何處理Angular應用的錯誤消息: No pipe found with name async

import之後問題解決:

如何處理Angular應用的錯誤消息: No pipe found with name async

繼續閱讀