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"}
            });
        }])
0

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

1 Comment

Yeah, I think this will do. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.