当前位置: 首页>>代码示例>>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;未经允许,请勿转载。