goodeggs / angular-cached-resource

An AngularJS module to interact with RESTful resources, even when browser is offline
MIT License
216 stars 29 forks source link

$resource feature - not able to do with angular-cached-feature #96

Open angularPublic opened 7 years ago

angularPublic commented 7 years ago

I am having a $resource defined as factory like below,

product-svc.js

(function() { 'use strict'; angular.module('module-name').factory('factory-name', factoryImplementation); factoryImplementation.$inject = ['$resource'];

/* @ngInject */
function factoryImplementation($resource) {
    return $resource('', {}, {
        getProducts : {
            method : 'GET',
            url : 'http://locahost:8080/product',
            params : {}
        },
        getProductById : {
            method : 'GET',
            url : 'http://locahost:8080/product/:id',
            params : {}
        }       
    });
}

})();

I just replaced $resource with $cachedResource. It is not working.

Can you help how can I do this?