I am looking for a correct way to handle a data type that can be obtained via different resource urls. Please see code examples below:
storeServices.factory('Booklist', ['$resource',
function($resource){
return $resource('http://some.domain.com/api/stores/:storeId/booklists/',
{}, {
query: {method:'GET', params:{storeId:'@storeId'}, isArray:true}
});
},
]);
But separately there is another API for getting just the list of books without the need to specify storeId. Eg:
http://some.domain.com/api/booklists/
Should I create a different factory with different name or is there a better/correct way? Thanks in advance to any replies.