No provider for AngularFireDatabase, AngularFireAuth

后端 未结 6 2079
不思量自难忘°
不思量自难忘° 2020-11-29 05:12

Apologies as I can\'t think of a better way of including all the information... When I run this, I get an error saying the following. I\'ve followed the Ionic Docs to the T,

6条回答
  •  伪装坚强ぢ
    2020-11-29 05:51

    Make sure FireBaseDatabaseModule is imported from angularfire2/database-deprecated if youre using FireBaseDatabase from angularfire2/database-deprecated

    and vice-versa. The only problem is the mismatch of import statements because they need to belong to the same package either

    angularfire2/database or angularfire2/database-deprecated

    if you would try to import the database from the first and the module from the second package or vice-versa. It wont recognize it as a DatabaseModule or Database.

    ------------ ROOT MODULE -------------

        import { AngularFireDatabaseModule } from "angularfire2/database-deprecated"
        imports: [
            BrowserModule,
            RouterModule.forRoot(appRoutes),
            FormsModule,
            AngularFireModule,
            AngularFireDatabaseModule,
            AngularFireAuthModule,
            AngularFireModule.initializeApp(environment.firebase)    
    ]
    

    ------- SERVICE CLASS ------------

    import { AngularFireDatabase, FirebaseListObservable } from "angularfire2/database-deprecated";
    

提交回复
热议问题