本文整理汇总了TypeScript中ngx-restangular.Restangular.one方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Restangular.one方法的具体用法?TypeScript Restangular.one怎么用?TypeScript Restangular.one使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ngx-restangular.Restangular
的用法示例。
在下文中一共展示了Restangular.one方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: getAvailableBlocks
getAvailableBlocks(owner: noosfero.Profile | noosfero.Environment): Promise<noosfero.RestResult<noosfero.BlockDefinition[]>> {
let restRequest;
if (owner.type === 'Environment') {
restRequest = this.restangular.one("environments", owner.id);
} else {
restRequest = this.restangular.one("profiles", owner.id);
}
return restRequest.all("blocks").get("available_blocks").toPromise();
}
示例2: getDish
getDish(id: number): Observable<Dish> {
// restangular.one: would get information from baseURL+'/dishes'+'/:id'
return this.restangular.one('dishes', id).get();
}
示例3: getPromotion
getPromotion(id: number): Observable<Promotion> {
return this.restangular.one('promotions',id).get();
}
示例4: getLeader
getLeader(id: number): Observable<Leader> {
return this.restangular.one('leaders',id).get()
.catch(error => {return error; } );
}
示例5: getDish
getDish(id: number): Observable<Dish> {
return this.restangular.one('dishes',id).get();
}
示例6: getLeader
getLeader(id: number): Observable<Leader> {
return this.restangular.one('leaders',id).get();
}
示例7: getPromotion
getPromotion(id: number): Observable<Promotion> {
return this.restangular.one('promotions',id).get()
.catch(error => { return error; } );;
}
示例8: getCommunityElement
getCommunityElement(communityId: number) {
return this.restangular.one('communities', communityId);
}
示例9: get
get(id: string): Observable<T> {
return this.restangularService.one(id).get();
}
示例10: delete
delete(obj: T) {
return this.restangularService.one(obj.id).delete();
}