AngularJS Caching a REST request

前端 未结 2 442
迷失自我
迷失自我 2021-01-03 00:48

I\'m new to angularJS and have a question about caching etc.

I have a wizard with two steps, I want to be able to click back and next and have the forms still filled

相关标签:
2条回答
  • 2021-01-03 01:10

    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
        }
      })
     };
    
    0 讨论(0)
  • 2021-01-03 01:16

    if you replace $resource with $http then you can directly use below code

    $http({
        method: 'PUT',
        url: 'url',
        cache:true
    });
    
    0 讨论(0)
提交回复
热议问题