【问题标题】:Invalidate a Restangular cache response使 Restangular 缓存响应无效
【发布时间】:2015-03-02 19:51:22
【问题描述】:

我有这段代码,所以我的 GET 请求被缓存了。

RestangularConfigurer.setDefaultHttpFields({cache: true});

我想在一小时后使回复无效。是怎么做到的?

【问题讨论】:

    标签: angularjs get restangular


    【解决方案1】:

    $cacheFactory.get('http').remove('http://urlToRemove')

    当然,你的控制器需要注入 $cacheFactory 才能得到这个。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-10-27
      • 1970-01-01
      • 2012-03-03
      • 2011-05-15
      • 2014-06-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多