简体   繁体   English

/angularfire2/index 没有导出成员 'AngularFire'

[英]/angularfire2/index has no exported member 'AngularFire'

Can't fix this problem:无法解决此问题:

app.component.ts应用程序组件.ts

import { AngularFire, AuthProviders, AuthMethods } from 'angularfire2';

/angularfire2/index has no exported member 'AngularFire',
/angularfire2/index has no exported member 'AuthProviders',
/angularfire2/index has no exported member 'AuthMethods '

but in app.module.ts但在 app.module.ts

import { AngularFireModule } from 'angularfire2';

works fine and I can initialize the app工作正常,我可以初始化应用程序

package.json包.json

"angularfire2": "^4.0.0-rc.0",
"core-js": "^2.4.1",
"firebase": "^3.9.0",
...
"devDependencies": {...
"ts-node": "~2.0.0",
"tslint": "~4.5.0",
"typescript": "~2.2.0"

Since you are using angularfire2@4.0.0+, there is no AngularFire exported any more.由于您使用的是 angularfire2@4.0.0+,因此不再导出AngularFire Instead, you shall use it as below:相反,您应该按如下方式使用它:

// import AngularFireAuthModule at NgModule
import { AngularFireAuthModule } from 'angularfire2/auth';


import { AngularFireAuth } from 'angularfire2/auth';
// inject 
construstor(afa: AngularFireAuth) {
  afa.auth.signInWithPopup()
}

Upgrading to AngularFire2 4.0 solve my issue升级到 AngularFire2 4.0 解决了我的问题

Migration Guide: https://github.com/angular/angularfire2/blob/master/docs/version-4-upgrade.md迁移指南: https ://github.com/angular/angularfire2/blob/master/docs/version-4-upgrade.md

The solution is:解决办法是:

With the "angularfire2": "^5.1.1",使用"angularfire2": "^5.1.1",

you need this libraries too:你也需要这个库:

"rxfire": "^3.3.5",
"rxjs": "6.3.3",
"rxjs-compat": "6.3.3",

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AngularFire2 退订不是 function - AngularFire2 unsubscribe is not a function 反转 angularfire2 中的可观察数组 angular 6 - reverse an observable array in angularfire2 angular 6 angularfire2 增加价值的最佳方式? - angularfire2 best way to increment a value? 从 'angularfire2/database' 导入 {AngularFireDatabase, FirebaseListObservable} - import {AngularFireDatabase, FirebaseListObservable} from 'angularfire2/database' angularfire2/auth signOut 后如何断开与 Google 身份验证的连接? - How to disconnect from Google authentication after angularfire2/auth signOut? AngularFire2 - Firebase 存储 getDownloadURL() - 如何返回 firestore 的 url - AngularFire2 - Firebase storage getDownloadURL() - How to return the url for firestore 为什么不显示来自 Firebase 实时数据库的列表? 使用 Ionic 和 AngularFire2 - Why won't List from Firebase Realtime Database display? Using Ionic and AngularFire2 Angular/angularfire2 - 读取可观察文档并将数据保存到 object。无异步 pipe - Angular/angularfire2 - Read a document observable and save the data to an object. No async pipe 如何在 Angular2 服务中注入 FirebaseApp 以将 firebase.storage() 与 AngularFire2 一起使用 - How to inject FirebaseApp in Angular2 service to use firebase.storage() with AngularFire2 AngularFire - 新的提供者语法 - AngularFire - New Provider Syntax
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM