在 ionic angular 7 项目上安装 firebase

问题描述 投票:0回答:1

我使用 ng add @angular/fire 将 firebase 添加到 ionic angular 7 项目。当我检查 package.json 文件时,我发现只有 @angular/fire 没有 firebase 包和 rxfire 包。 还创建了离子应用程序生成独立版本的角度没有 app.module.ts

现在我知道我需要在导入的组件中添加供应商

provideFirebaseApp(() => initializeApp(environment.firebase)),
provideFirestore(() => getFirestore())

但我需要知道在哪个组件中

angular firebase ionic-framework angularfire angular-standalone-components
1个回答
0
投票

最合理的是创建 app.module.ts 并运行 ng add @angular/fire,向导完成后,将 AppModule 插入每个需要 firebase 的组件的导入部分。

© www.soinside.com 2019 - 2024. All rights reserved.