【问题标题】:Restangular, setResponseInterceptor for a single requestRestangular, setResponseInterceptor 用于单个请求
【发布时间】:2014-09-17 21:50:02
【问题描述】:

我正在使用带有 AngularJS 的 Restangular,我们可以为单个请求设置 responseInterceptor,而不是为所有请求设置吗?

【问题讨论】:

    标签: angularjs restangular


    【解决方案1】:

    你可以这样做;

    var BondRestangular = Restangular.withConfig(function(RestangularConfigurer) {
      RestangularConfigurer.setResponseInterceptor(function(data, operation, what) {
        // do your thing
        return data;
      )};
    });
    
    BondRestangular.all('actions').getList();
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-05-17
      • 1970-01-01
      • 2014-02-13
      • 2023-04-04
      • 2017-01-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多