angularjs: how to add caching to resource object?

后端 未结 8 685
栀梦
栀梦 2020-12-02 08:08

To add caching inside http is pretty straight forward. ( by passing cache=true )

http://docs.angularjs.org/api/ng.$http has Cache option.

How do I add simila

8条回答
  •  甜味超标
    2020-12-02 08:56

    Since 1.1.2 (commit), all the $httpConfig options are directly exposed in $resource action objects:

    return {
      Things: $resource('url/to/:thing', {}, {
        list : {
          method : 'GET',
          cache : true
        }
      })
     };
    

提交回复
热议问题