2
私はAngular4(4.3.6)とAngularFire2(4.0.0-rc.2)を使用します。データがあまりにも少し遅れて来るので、私は、データが、コンソールのスローエラーを取得し、このようにAngularFire2 - db.objectで単一オブジェクトを取得 - データが遅くに来る
// GET THE ID
this.id = this.route.snapshot.params['id'];
this.subscriptions.push(
this.db.object('/restaurants/' + this.id).subscribe(data => {
this.restaurant = data;
console.log(data);
})
);
:私は詳細ビューのためのデータを得ます。最後に、詳細ビューのルートとしてオブジェクト名を使用したいので、route.paramsからIDを取得したくないです。
ここStackBlitz:https://stackblitz.com/edit/angular-7gabaq?file=sites/site-restaurant-detail/site-restaurant-detail.component.ts( "ビューレストラン" をクリックします)