本文整理匯總了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();
}