我正在尝试在点击NativeScript应用项目时动态地获取产品。我目前使用的是firebase,我对它不熟悉。
下面是我的方法
getDish(id: number): Observable<Dish> {
return this.http.get<Dish>(baseURL +'dishes.json/'+ id)
.pipe(catchError(this.processHTTPMsgService.handleError));
}
而这里是firebase目标"[firebaseName]firebaseio.comdishes0" [1234等]。
我做错了什么?
如果你有特别的纠正或链接,将非常感激。
该 .json
后缀需要放在URL的最后。
return this.http.get<Dish>(baseURL +'dishes/'+ id + '.json')