Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

i had problem to

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

i imported AngularFireDatabase but FirebaseListObservable was under a red line after searching this post helped me resolve my problem Getting an error: "Has no exported member AngularFire, AuthProviders, AUthMethods, FirebaseListObservable" in AngularFire2?

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

but when i compile i get and it cant help i dont know what to do where searching ect core.es5.js:1020 ERROR Error: Uncaught (in promise): Error: No provider for AngularFireDatabase! Error: No provider for AngularFireDatabase!

"angularfire2": "^5.0.0-rc.2", "core-js": "^2.4.1", "firebase": "^4.5.0",

like image 468
asli Avatar asked Dec 07 '22 16:12

asli


1 Answers

i got the answer after reading https://github.com/angular/angularfire2/blob/master/CHANGELOG.md 5.0.0-rc.0 (2017-10-03)

the -deprecated allows you to use the old database API

import { AngularFireDatabaseModule } from 'angularfire2/database-deprecated';

in the app.module.js and in your service you use

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

thank you both of you, you helped me

like image 124
asli Avatar answered Dec 10 '22 12:12

asli