AngularFireAuth的提供者

AngularFireAuth的提供者

本文介绍了没有AngularFireDatabase,AngularFireAuth的提供者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

道歉,因为我想不出包括所有信息的更好的方法...当我运行这个,我得到一个错误说下面。我已经按照Ionic Docs的T,我不能找出什么可能是错的。



错误:



Package.json



App.module.ts



Home.html



Home.ts
与AngularAuth相同)从
版本分开为它自己的模块 AngularFireDatabaseModule (AngularFireAuthModule for AngularAuth ) > [email protected] ,请参阅 documentation



您应该在 RootModule AngularFireDatabaseModule AngularFireAuthModule for Authentication

$ p $ 从'angularfire2'导入{AngularFireModule};
//用于AngularFireDatabase
从'angularfire2 / database'中导入{AngularFireDatabaseModule};
从'angularfire2 / database'导入{AngularFireDatabase,FirebaseObjectObservable};
//用于AngularFireAuth
从'angularfire2 / auth'中导入{AngularFireAuthModule};
从'angularfire2 / auth'导入{AngularFireAuth};

@NgModule({
imports:[
AngularFireModule.initializeApp({< ---- main module
apiKey:...,
authDomain:'...',
databaseURL:'...',
storageBucket:'...',
messagingSenderId:'...'
}),
AngularFireDatabaseModule,< ---- for database
AngularFireAuthModule< ---- for auth
]
})


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, I can't figure out what could possibly be wrong.

Error:

Package.json

App.module.ts

Home.html

Home.ts

解决方案

AngularDatabase(same for AngularAuth) is separated to its own module AngularFireDatabaseModule(AngularFireAuthModule for AngularAuth) from version [email protected], see documentation here.

you should import AngularFireDatabaseModule(AngularFireAuthModule for Authentication) in your RootModule.

import { AngularFireModule } from 'angularfire2';
// for AngularFireDatabase
import { AngularFireDatabaseModule } from 'angularfire2/database';
import { AngularFireDatabase, FirebaseObjectObservable } from 'angularfire2/database';
// for AngularFireAuth
import { AngularFireAuthModule } from 'angularfire2/auth';
import { AngularFireAuth } from 'angularfire2/auth';

@NgModule({
  imports: [
    AngularFireModule.initializeApp({         <---- main module
      apiKey: ...,
      authDomain: '...',
      databaseURL: '...',
      storageBucket: '...',
      messagingSenderId: '...'
    }),
    AngularFireDatabaseModule,                <---- for database
    AngularFireAuthModule                     <---- for auth
  ]
})

这篇关于没有AngularFireDatabase,AngularFireAuth的提供者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 15:46