I tried to use firebase in my Angular app:
import {AngularFireModule} from 'angularfire2';
import {AngularFireDatabaseModule} from 'angularfire2/database';
import {environment} from '../environments/environment';
...
@NgModule({
...
imports: [
BrowserModule,
...
AngularFireDatabaseModule,
AngularFireModule.initializeApp(environment.firebaseConfig, 'my-app')
],
...
})
However, I got an error:
class AngularfireModule is not an Angular Module
and
class AngularFireDatabaseModule is not an Angular Module
I don't know if this is the correct way to use Firebase with Angular 8, or if there is another way.
You need to download @angular/fire
not angularfire2
. angularfire2 is an old version of @angular/fire
.
Angular 6+ or 7/8+ command ng add @angular/fire
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With