Closed Hillel-Nagid closed 6 years ago
I'm getting the same issue Argument of type '{ query: { limitTolast: number; orderByKey: boolean; }; }' is not assignable to parameter of type 'QueryFn'. Object literal may only specify known properties, and 'query' does not exist in type 'QueryFn'.
hii. i have this problem also. Maybe you found what need to do yet?
firstly it's need to be together //import { AngularFireDatabase, FirebaseListObservable } from 'angularfire2/database-deprecated';
secondly it's my funcshion
getMessages(): FirebaseListObservable<ChatMessage[]> { // query to create our message feed binding return this.db.list('message', { query: { limitToLast: 20 } }); }
and it's work now.
Thanks 3669
ERROR in src/app/services/chat.service.ts(55,39): error TS2345: Argument of type '{ query: { limitToLast: number; }; }' is not assignable to parameter of type 'FirebaseListFactoryOpts'. Types of property 'query' are incompatible. Type '{ limitToLast: number; }' is not assignable to type 'Query'. Property 'endAt' is missing in type '{ limitToLast: number; }'. whats happening??
chat.services.ts
getMessages(): FirebaseListObservable<ChatMessage[]> { // query to create our message feed binding return this.db.list('messages', { query: { limitToLast: 20,
}
});
}
ERROR in src/app/services/chat.service.ts(48,7): error TS2345: Argument of type '{ query: { limitToLast: number; orderByKey: boolean; }; }' is not assignable to parameter of type 'QueryFn'. Object literal may only specify known properties, and 'query' does not exist in type 'QueryFn'. ../../node_modules/rxjs-compat/Observable.d.ts(1,28): error TS2307: Cannot find module 'rxjs'. ../../node_modules/rxjs-compat/Observable.d.ts(2,70): error TS2307: Cannot find module 'rxjs'.
For AngularFire version 5 and up use,
db.list('/items', ref => ref.orderByChild('size').equalTo('large'));
for details please refer here
'query' does not exist in type 'QueryFn'