0

I'm creating an Ionic app where there is a list of information that I want to display, I'm using Firebase as my database (Realtime Database).

But I've been getting this error:

Object(...) is not a function

And I'm not sure why since the code seems fine (I checked angularfire2 git to make sure).

So here's the code:

list.ts

import { Component } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';
import { AngularFireDatabase } from 'angularfire2/database';


@Component({
  selector: 'page-list',
  templateUrl: 'list.html'
})
export class ListPage {

  informationslist:any;

  constructor(public navCtrl: NavController, public navParams: NavParams,
  private afDB: AngularFireDatabase) {



      try{
      this.informationslist = afDB.list('information',  (ref) => 
      ref.orderByChild('datetime')).valueChanges();

      }catch(e){

        console.log(e);
      }


  }



}

list.html

<ion-header>
  <ion-navbar>
    <button ion-button menuToggle>
      <ion-icon name="menu"></ion-icon>
    </button>
    <ion-title>List</ion-title>
  </ion-navbar>
</ion-header>

<ion-content>

<ion-list>
  <ion-item *ngFor="let i of informationslist | async">{{i.title}}</ion-item>
</ion-list>



</ion-content>

1 Answer 1

4

Can you please provide the version of rxjs. In most cases there could be a problem with the wrong version of it. I think current angularfire2 needs rxjs version 6.0.0 or greater. The full javascript stack could also be useful.

Also if you used another rxjs version before and now try to upgrade consider the migration guide for this: Migration guide rxjs from 5 to 6

Sign up to request clarification or add additional context in comments.

3 Comments

rxjs 5.5.10 (from package.json)
upgrade to version 6 using my link of migration guide

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.