wesdoyle / base-chat

A simple chat application built using Angular and Firebase
52 stars 52 forks source link

query error #7

Open anonnoisy opened 6 years ago

anonnoisy commented 6 years ago

getMessages(): FirebaseListObservable<ChatMessage[]> { // query to create our message feed binding return this.db.list('message',{ query: { limitToLast: 20, orderByKey: true } }); }

anthony-coplo commented 6 years ago

Hello i have the same error, how can I fix it ?

JBuckGuy commented 6 years ago

same :/

sameeranihathe commented 6 years ago

Same here, please help

toufikImk commented 6 years ago

I had the same issue but it's solved now:

  1. change

    getMessages in chat.service.ts to be like this getMessages():FirebaseListObservable<ChatMessage[]>{ return this.db.list('Messages', { query :{ limitToLast:25, orderByKey:true } }); }

  2. in chat.service.ts and app.module.ts you have to change import {AngularFireDatabaseModule} from'angularfire2/database'; //to be like this import {AngularFireDatabaseModule} from 'angularfire2/database-deprecated';
Lertis commented 5 years ago

Hi @anonnoisy, @anthony-coplo, @JBuckGuy, @sameeranihathe Look at this https://github.com/wesdoyle/base-chat/issues/10#issuecomment-459274318

seigne-m commented 5 years ago

AngularFire has moved, we're now @angular/fire you have to use '@angular/fire/database-deprecated' in place of 'angularfire2/database-deprecated' or 'angularfire2/database' This worked for me.