1

Essentially, I want to be able to automatically load cached data and then update that data. This will ensure (beside the very first load) the user will always have content available. From what I know of $resource, I can cache the return but how do I refresh the data as well?

This is what I have

angular.module('myApp.services', ['ngResource'])
    .factory('About', ['$resource',
        function ($resource) {
            return $resource(services.about, {}, {get: 
                {
                    cache:true, 
                    method: "GET"}
            });
        }])
KJ Price
  • 5,774
  • 3
  • 21
  • 34

1 Answers1

1

Refresh data, you mean update it? If so, you have to play around with $cacheFactory

Source: How to refresh / invalidate $resource cache in AngularJS

Community
  • 1
  • 1
jamesy829
  • 428
  • 4
  • 7