Angularfire: Uncaught Error: Unexpected value 'AngularFireDatabase' imported by the module 'AppModule'. Please add a @NgModule annotation.

Created on 2 Dec 2018  路  1Comment  路  Source: angular/angularfire

Version info

Angular:
i麓m using angular 6
Firebase:
"firebase": "^5.5.8"
AngularFire:
"@angular/fire": "^5.1.0"
Other (e.g. Ionic/Cordova, Node, browser, operating system):

How to reproduce these conditions

Failing test unit, Plunkr, or JSFiddle demonstrating the problem

Steps to set up and reproduce

Sample data and security rules

<-- include/attach/link to some json sample data (or provide credentials to a sanitized, test Firebase project) -->

Debug output

* Errors in the JavaScript console *
Uncaught Error: Unexpected value 'AngularFireDatabase' imported by the module 'AppModule'. Please add a @NgModule annotation.
* Output from firebase.database().enableLogging(true); *

* Screenshots *

Expected behavior


i want to fetch list of my data

Actual behavior

Most helpful comment

In your app.module.ts, import AngularFireDatabaseModule instead of AngularFireDatabase.

And then you can use AngularFireDatabase in your service/component

import { AngularFireDatabaseModule } from 'angularfire2/database';
......
imports: [
....
AngularFireDatabaseModule,
.....
]

>All comments

In your app.module.ts, import AngularFireDatabaseModule instead of AngularFireDatabase.

And then you can use AngularFireDatabase in your service/component

import { AngularFireDatabaseModule } from 'angularfire2/database';
......
imports: [
....
AngularFireDatabaseModule,
.....
]
Was this page helpful?
0 / 5 - 0 ratings

Related issues

KLiFF2606 picture KLiFF2606  路  3Comments

DennisSmolek picture DennisSmolek  路  3Comments

isylhdin picture isylhdin  路  3Comments

itisparas picture itisparas  路  3Comments

StephenFluin picture StephenFluin  路  3Comments