import { AngularFire,AuthProviders,AuthMethods,FirebaseListObservable } from 'angularfire2';
我说每个模块都有错误
Has no exported member AngularFire,AUthMethods,FirebaseListObservable.
谢谢
import { AngularFire,AuthProviders,AuthMethods,FirebaseListObservable } from 'angularfire2';
我说每个模块都有错误
Has no exported member AngularFire,AUthMethods,FirebaseListObservable.
谢谢
在收到此错误时,这意味着您使用的是旧的Database API.这可以通过从depracated模块导入FirebaseListObservable来解决(另请参阅@Ashish Jha答案):
import { AngularFireModule } from 'angularfire2'; import { AngularFireDatabase,FirebaseListObservable,FirebaSEObjectObservable } from 'angularfire2/database-deprecated';
由于AngularFire 5.0为实时数据库带来了新的API,因此建议使用最新的API.请参阅升级guide.
原始答案:
自4.0.0以来,AngularFire2已将其模块分开.
如果你想使用angularfire2的auth,你可以导入这两个模块,看看他们的变化log:
import {AngularFireModule} from 'angularfire2'; // for auth import {AngularFireAuthModule} from 'angularfire2/auth'; // for database import {AngularFireDatabaseModule} from 'angularfire2/database';
并导入Auth和Observable(AuthMethods可以在AngularFireAuth中找到)类型:
// for auth import { AngularFireAuth } from 'angularfire2/auth'; // for database import { AngularFireDatabase } from 'angular2/database'; // for Observables import {FirebaseListObservable,FirebaSEObjectObservable } from 'angularfire2/database';