在Ionic6和Angular8項目中使用組件時出現錯誤:Error: No component factory found for LoginComponent. Did you add it to @NgModule.entryComponents? 在我的上一篇文章:移動開發:Ionic框架實現註冊與登錄功能中,實現軟件運行時彈出登錄頁面,使用的就是組件化(component)。
就是增加entryComponents:[LoginComponent],用於解決上面的問題。並且在declarations中加入LoginComponent,不然還會出現“Component LoginComponent is not part of any NgModule or the module has not been imported into your module.”錯誤。