當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript FirebaseObjectObservable.subscribe方法代碼示例

本文整理匯總了TypeScript中angularfire2/angularfire2.FirebaseObjectObservable.subscribe方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript FirebaseObjectObservable.subscribe方法的具體用法?TypeScript FirebaseObjectObservable.subscribe怎麽用?TypeScript FirebaseObjectObservable.subscribe使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在angularfire2/angularfire2.FirebaseObjectObservable的用法示例。


在下文中一共展示了FirebaseObjectObservable.subscribe方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: constructor

 constructor(private af: AngularFire){
   this.votes = af.database.object('/votes');
   this.votes.subscribe((res) => {
       this.dates = res;
   });
   this.dishes = [
     {
     "distance":"0.13808051082295206",
     "restaurant_name":"Restaurace K The Two Brothers",
     "rating":92,
     "id_restaurant":2172,
     "lat":50.0912692,
     "long":"14.43358390000003",
     "name":"Butter naan",
     "description":"Indick\u00fd chl\u00e9b pot\u0159en\u00fd m\u00e1slem.",
     "ammount":null,
     "price":50,
     "image_url":"https:\/\/www.restu.cz\/ir\/restaurant\/0db\/0db0d6d486eb69ed829b762f83e618f5.jpg"
  },
  {
     "distance":"0.13808051082295206",
     "restaurant_name":"Restaurace K The Two Brothers",
     "rating":92,
     "id_restaurant":2172,
     "lat":50.0912692,
     "long":"14.43358390000003",
     "name":"Plain Roti",
     "description":"Celozrnn\u00fd chl\u00e9b pe\u010den\u00fd v peci Tandoor.",
     "ammount":null,
     "price":40,
     "image_url":"https:\/\/www.restu.cz\/ir\/restaurant\/0db\/0db0d6d486eb69ed829b762f83e618f5.jpg"
  },
  {
     "distance":"0.1452246946411884",
     "restaurant_name":"Bistro Tobruk",
     "rating":83,
     "id_restaurant":1262,
     "lat":"50.09184385046584",
     "long":"14.432612404264432",
     "name":"Croissant",
     "description":"s dom\u00e1c\u00ed marmel\u00e1dou a m\u00e1slem",
     "ammount":null,
     "price":49,
     "image_url":"https:\/\/www.restu.cz\/ir\/restaurant\/283\/283537b3fd8e356d9ff13cd10dd39b1a.jpg"
  }
   ]
 }
開發者ID:MartinNuc,項目名稱:usertech-lunch-app,代碼行數:47,代碼來源:item.component.ts


注:本文中的angularfire2/angularfire2.FirebaseObjectObservable.subscribe方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。