I would like to know the best practice for connecting with my API as it works as following:
- GET -> products/list/latest -> return list of latest products
- GET -> products/list/popular -> return list of popular products
- GET -> products/list/trending -> return list of trending products
and then when I want a detail of the each product, it is just:
GET -> products/:id
I got the following code in my services.js:
.factory('ProductService', function ($resource) {
return $resource('http://domainname.com/api/products/:product',{product: "@product"});
})
But I really don't know how to access these custom URLs. Can I use the ngResource for that?
Thanks!