本文整理汇总了TypeScript中ngx-restangular.Restangular类的典型用法代码示例。如果您正苦于以下问题:TypeScript Restangular类的具体用法?TypeScript Restangular怎么用?TypeScript Restangular使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Restangular类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: OpenfactRestangularFactory
export function OpenfactRestangularFactory(restangular: Restangular, configService: ConfigService, toastr: ToastsManager) {
const config = restangular.withConfig((RestangularConfigurer) => {
RestangularConfigurer.addErrorInterceptor((error, operation, what, url, response) => {
return OpenfactErrorInterceptor(error, operation, what, url, response, toastr);
});
RestangularConfigurer.setBaseUrl(configService.getSettings().apiEndpoint);
});
return config;
}
开发者ID:openfact,项目名称:openfact-web-console,代码行数:9,代码来源:openfact.restangular.ts
示例2: mapperRestangularProvider
export function mapperRestangularProvider(
restangular: Restangular,
config: ConfigService
) {
return restangular.withConfig(restangularConfigurer => {
const mapperEndpoint = config.getSettings().mapperEndpoint;
restangularConfigurer.setBaseUrl(
mapperEndpoint ? mapperEndpoint : '/mapper/v1'
);
});
}
开发者ID:hawtio,项目名称:hawtio-ipaas,代码行数:11,代码来源:app.module.ts
示例3: constructor
constructor(restangular: Restangular) {
super(restangular.service('integrationtemplates'), 'integrationtemplate');
}
开发者ID:hawtio,项目名称:hawtio-ipaas,代码行数:3,代码来源:template.service.ts
示例4: 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();
}
开发者ID:vfcosta,项目名称:angular-theme,代码行数:9,代码来源:block.service.ts
示例5: 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
示例6: restangularize
/**
* If a new item has been loaded via a websocket then lets restanguarlize it
* so that the REST APIs appear on it
*/
restangularize(item: T): T {
const restangularService = this.restangularService;
const parent = restangularService.parentResource;
const route = restangularService.route;
const fromServer = restangularService.fromServer;
const collection = restangularService.restangularCollection;
const reqParams = restangularService.reqParams;
return this.restangularService.restangularizeElement(parent, item, route, fromServer, collection, reqParams);
}
开发者ID:openfact,项目名称:openfact-web-console,代码行数:13,代码来源:rest.service.ts
示例7: submitFeedback
submitFeedback(feedback: Feedback): Observable<Feedback> {
return this.restangular.all('feedback').post(feedback);
}
开发者ID:sandy100,项目名称:Coursera,代码行数:3,代码来源:feedback.service.ts
示例8: getDish
getDish(id: number): Observable<Dish> {
// restangular.one: would get information from baseURL+'/dishes'+'/:id'
return this.restangular.one('dishes', id).get();
}
开发者ID:PriscillaLii,项目名称:conFusion2,代码行数:4,代码来源:dish.service.ts
示例9: getPromotion
getPromotion(id: number): Observable<Promotion> {
return this.restangular.one('promotions',id).get();
}
开发者ID:sandy100,项目名称:Coursera,代码行数:3,代码来源:promotion.service.ts
注:本文中的ngx-restangular.Restangular类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论