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


TypeScript Restangular.all方法代碼示例

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


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

示例1: getFeaturedDish

 getFeaturedDish(): Observable<Dish> {
   // restangular.all('dishes') find all information from /dishes
   // getList({featured: true}: find all information of dishes where featured=true
   // pipe: use the dishes array provide by last step as a parameter to execute map
   // map: take dishes parameter, return the first one of this
   return this.restangular.all('dishes').getList({featured: true}).pipe(map(dishes => dishes[0]));
 }
開發者ID:PriscillaLii,項目名稱:conFusion2,代碼行數:7,代碼來源:dish.service.ts

示例2: getFeaturedPromotion

 getFeaturedPromotion(): Observable<Promotion> {
   return this.restangular.all('promotions').getList({featured: true})
     .map(promotions => promotions[0]);
 }
開發者ID:sandy100,項目名稱:Coursera,代碼行數:4,代碼來源:promotion.service.ts

示例3: getDishes

 //return in array of dishes
 getDishes(): Observable<Dish[]> {
   // restangular.all: would make HTTP request use baseURL+'/dishes' as root source and get all the data from it.
   // baseURL is defined in restConfig.ts
   return this.restangular.all('dishes').getList();
 }
開發者ID:PriscillaLii,項目名稱:conFusion2,代碼行數:6,代碼來源:dish.service.ts

示例4: getFeaturedLeader

  getFeaturedLeader(): Observable<Leader> {
    return this.restangular.all('leaders').getList({featured: true})
    .map(leaders => leaders[0])
    .catch(error => { return error; } );
 }
開發者ID:bhaggya,項目名稱:conFusion,代碼行數:5,代碼來源:leader.service.ts

示例5: getPromotions

 getPromotions(): Observable<Promotion[]> {
   return this.restangular.all('promotions').getList();
 }
開發者ID:sandy100,項目名稱:Coursera,代碼行數:3,代碼來源:promotion.service.ts

示例6: submitFeedback

 submitFeedback(feedback: Feedback): Observable<Feedback> {
   return this.restangular.all('feedback').post(feedback);
 }
開發者ID:sandy100,項目名稱:Coursera,代碼行數:3,代碼來源:feedback.service.ts

示例7: getLeaders

 getLeaders(): Observable<Leader[]> {
   return this.restangular.all('leaders').getList()
   .catch(error => { return error; } );
   
 }  
開發者ID:bhaggya,項目名稱:conFusion,代碼行數:5,代碼來源:leader.service.ts

示例8: submitFeedbacks

 submitFeedbacks(feed : Feedback): Observable<Feedback[]> {
   console.log("Feedback from service" +feed);
   return this.restangular.all('feedback').post(feed);
 }
開發者ID:bhaggya,項目名稱:conFusion,代碼行數:4,代碼來源:feedback.service.ts

示例9: newPassword

 newPassword(code: string, password: string, password_confirmation: string): Promise<noosfero.RestResult<noosfero.User>> {
     return this.restangular.all("").customOperation("patch", "new_password", { code: code, password: password, password_confirmation: password_confirmation }).toPromise();
 }
開發者ID:vfcosta,項目名稱:angular-theme,代碼行數:3,代碼來源:password.service.ts

示例10: getFeaturedDish

 getFeaturedDish(): Observable<Dish> {
   return this.restangular.all('dishes').getList({featured: true})
          .map(dishes => dishes[0]);
 
 }
開發者ID:bhaggya,項目名稱:conFusion,代碼行數:5,代碼來源:dish.service.ts


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