本文整理匯總了TypeScript中ngx-restangular.Restangular.withConfig方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Restangular.withConfig方法的具體用法?TypeScript Restangular.withConfig怎麽用?TypeScript Restangular.withConfig使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ngx-restangular.Restangular
的用法示例。
在下文中一共展示了Restangular.withConfig方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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;
}
示例2: mapperRestangularProvider
export function mapperRestangularProvider(
restangular: Restangular,
config: ConfigService
) {
return restangular.withConfig(restangularConfigurer => {
const mapperEndpoint = config.getSettings().mapperEndpoint;
restangularConfigurer.setBaseUrl(
mapperEndpoint ? mapperEndpoint : '/mapper/v1'
);
});
}
示例3: KeycloakRestangularFactory
export function KeycloakRestangularFactory(restangular: Restangular, toastr: ToastsManager) {
const config = restangular.withConfig((RestangularConfigurer) => {
RestangularConfigurer.setBaseUrl('http://localhost:3000');
});
return config;
}