Error Angularfire2 TS2305

I am new to the world of ion frames, and now I'm trying to create an application for a school project. To save data in the application, I will use firebase (for the first time). I am trying to import Angularfire and FirebaseListObservable into my .ts file, but I get this error message:

"TS2305: Module" 'C: / Users / matss / myRecords / node_modules / angularfire2 / index "' does not have an exported member 'AngularFire'.

Here is my import in app.module.ts

import { AngularFireModule } from 'angularfire2;

export const firebaseConfig = {
apiKey: "blablabla",
authDomain: "blablabla",
databaseURL: "blablabla",
projectId: "blablabla",
storageBucket: "blablabla",
messagingSenderId: "blablabla"
};

here is my code in excersises.ts that gives errormessage:

import { AngularFire, FirebaseListObservable } from 'angularfire2';

  constructor(private navParams: NavParams, public nacCtrl: NavController, af: AngularFire){
this.records = af.database.list('/records');

}

, "" , .. : https://www.joshmorony.com/building-a-crud-ionic-2-application-with-firebase-angularfire/

.

+1
1

, . , , , AngularFire2 , , .

, :

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

import { AngularFireModule } from 'angularfire2'; import { AngularFire } from 'angularfire2';

, , , , , . , .

.

, :

app.module.ts:

import { AngularFireDatabaseModule } from 'angularfire2/database';
import { AngularFireModule } from 'angularfire2';

@NgModule :

  imports: [
    AngularFireModule.initializeApp(firebaseConfig),
    AngularFireDatabaseModule 
]

ts, . :

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

records: FirebaseListObservable<any[]>;

:

constructor(private navParams: NavParams, public nacCtrl: NavController, db: AngularFireDatabase){
    this.records = db.list('/records');}
+4

Source: https://habr.com/ru/post/1017032/


All Articles