Angularfire and FirebaseListObservable do not have exported angularfire2 element using ionic 2 application

FirebaseListObservable and Angularfire do not have the exported member "angularfire2" when I create an Ionic 2 application to import both files in home.ts

My Cordoba and ionic version Cordoba version 6.5.0 Ionic version 2.2.3 Node version 6.10.2 type versions 2.1.1 typescript version 2.3.2

import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import {AngularFire, FirebaseListObservable} from 'angularfire2';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
constructor(public navCtrl: NavController, af:AngularFire ) {
}
}
+6
source share
5 answers

The solution is to simply change this line

import {AngularFire, FirebaseListObservable} from 'angularfire2'; 

to

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

* REFRENCE

+8
source

AngularFire 2.0.4 FirebaseListObservable FirebaseObjectObservable AngularFireList AngularFireObject.

:

import { AngularFireDatabase, AngularFireObject } from 'angularfire2/database';
+31

Ashish Jha, , AngularFirestore, Observable FirebaseListObservable. FirebaseListObservable push().

import {AngularFire, FirebaseListObservable} from 'angularfire2'; 

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

, !

+22

, , ,

import {AngularFire, FirebaseListObservable} from 'angularfire2'; 

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

You can read more about this here https://github.com/angular/angularfire2/blob/master/CHANGELOG.md

+5
source

Changing this to the following, I solved this for me:

import { AngularFireDatabase, AngularFireList } from 'angularfire2/database';
0
source

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


All Articles