本文整理汇总了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]));
}
示例2: getFeaturedPromotion
getFeaturedPromotion(): Observable<Promotion> {
return this.restangular.all('promotions').getList({featured: true})
.map(promotions => promotions[0]);
}
示例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();
}
示例4: getFeaturedLeader
getFeaturedLeader(): Observable<Leader> {
return this.restangular.all('leaders').getList({featured: true})
.map(leaders => leaders[0])
.catch(error => { return error; } );
}
示例5: getPromotions
getPromotions(): Observable<Promotion[]> {
return this.restangular.all('promotions').getList();
}
示例6: submitFeedback
submitFeedback(feedback: Feedback): Observable<Feedback> {
return this.restangular.all('feedback').post(feedback);
}
示例7: getLeaders
getLeaders(): Observable<Leader[]> {
return this.restangular.all('leaders').getList()
.catch(error => { return error; } );
}
示例8: submitFeedbacks
submitFeedbacks(feed : Feedback): Observable<Feedback[]> {
console.log("Feedback from service" +feed);
return this.restangular.all('feedback').post(feed);
}
示例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();
}
示例10: getFeaturedDish
getFeaturedDish(): Observable<Dish> {
return this.restangular.all('dishes').getList({featured: true})
.map(dishes => dishes[0]);
}