'query' does not exist in type 'QueryFn' | angularfire2

后端 未结 5 1211
渐次进展
渐次进展 2021-02-09 04:18

Argument of type \'{ query: { limitTolast: number; orderByKey: boolean; }; }\' is not assignable to parameter of type \'QueryFn\'.Object literal may only specify known propertie

5条回答
  •  [愿得一人]
    2021-02-09 05:01

    QueryFn must return a firebase.database.Query, not void. You can code the query like this one, for more clear:

    getMessages(): Observable {
        return this.db.list('/messages', ref => {
          let q = ref.limitTolast(25).orderByKey(true);
          return q;
        });
      }
    

提交回复
热议问题