"Function expected" error when using ngFor to return a Firebase string, using Ionic 3 and Angularfire2

Asked

Viewed 32 times

0

Galley,

I am using Ionic3 and Angularfire2 as follows. I have created a file. ts called Servide where I export a function called getAll to get all the list of a table called 'colors' in Firebase.

 constructor(public db: AngularFireDatabase) {  }
  getAll(){
    return this.db.list('cores').valueChanges();
  }`

Then I use "getAll" at another time to search the list

export class HomePage {

  private listaCores;

  constructor(public navCtrl: NavController, public dbService: FirebaseServiceProvider ) {
  this.listaCores = this.dbService.getAll();
  }

When I do this it goes all right and such, but when I try to show the listCores in the app effectively with the code below I have an error "Function Expected".

  <ul>
    <li *ngFor="let c of listaCores|async">
      {{c.descCor}}
    </li>
  </ul>

Does anyone have any idea what might be going on? I have searched several places and have not actually found the problem.

Thanks

1 answer

0

Guys, I figured out what I needed to do. It was a problem in rxjs, which I needed to update from 5.5 to 6.0, as Angular was not compatible with 5.5. I used the following command in the folder of the app and was successful: npm install rxjs@6 rxjs-compat@6 --save

Browser other questions tagged

You are not signed in. Login or sign up in order to post.