ianhuang筆記THE ADVENTURER'S JOURNAL
知識世界・持續探索中

ADVENTURE JOURNAL · 探索筆記

Angular_NullInjectorError

任務導覽 TABLE OF CONTENTS

前言

NullInjectorError: No provider for Pipe!

如果遇到 NullInjectorError 表示 沒有注入提供者

這邊是沒有註冊 Pipe

需註冊在 module 或是 component

@NgModule({

imports: [ .. ],

declarations: [ CustomPipe ],

exports: [ CustomPipe ],

providers: [ CustomPipe ]

})

export class SharedModule { }

參考

No Provider for CustomPipe - angular 4 - Stack Overflow

Angular依賴注入的一個常見錯誤NullInjectorError,No provider for XXX - 雲+社群 - 騰訊雲 (tencent.com)

冒險者留言

comments powered by Disqus

尋找你的下一個任務

輸入關鍵字,探索所有筆記。

ESC 關閉 · 搜尋標題、標籤與文章摘要