當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript ngx-restangular.Restangular類代碼示例

本文整理匯總了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;未經允許,請勿轉載。