ionic 4 angularfire 2编译错误TS1005:“,”预期

时间:2019-12-15 04:09:03

标签: ionic-framework ionic4 angularfire2

以下带有angularfire2的ionic 4 angular中的代码在编译时引发错误

src / app / data-service.service.ts(267,3)中的错误:错误TS1005:“,”。


getGallery() {
        return new Promise((resolve, reject) => {
          this.db.list('/gallery', ref => ref.orderByKey().limitToLast(5))
          .snapshotChanges()
          .pipe(map(items => {       // <== new way of chaining
            return items.map(a => {
              const data = a.payload.val()
              const key = a.payload.key
              return {key, data}          // or {key, ...data} in case data is Obj
            })
          }))
          .subscribe(
            (res:any) => {
                //console.log('stat is:' + JSON.stringify(res))
                resolve(res)
            },
            err => {
                console.log("failed in validate:" + err)
                reject(err)
            }
          )

    }
  }

0 个答案:

没有答案