I am having issue getting a basic CRUD to-do list app using Ionic 3 and Firebase to work.
The error message I am stuck on is:
Uncaught (in promise): Err
I think you are using the new angularfire2 version which is version 5 in this case you should be doing the following:
import { Component } from '@angular/core';
import { AngularFireDatabase } from 'angularfire2/database';
import { Observable } from 'rxjs/Observable';
@Component({
selector: 'page-shopping-list',
templateUrl: 'shopping-list.html',
})
export class ShoppingListPage {
shoppingListRef$: Observable<any[]>;
constructor(database: AngularFireDatabase) {
this.shoppingListRef$ = this.database.list('shopping-list').valueChanges();;
}
}
as starting from version 5 database.list
no longer returns an observable so you can't subscribe to it in the template using the async
pipe. this is why you should chain the valueChanges()
method which returns an Observable in this case.