The documentation doesn't seem to specify: http://docs.angularjs.org/api/ngResource.$resource
The main difference lies in query
having isArray: true
:
'get' : {method:'GET'},
'query': {method:'GET', isArray:true}
This means you would use get
when requesting a single object, and query
when requesting a collection. For example:
Users.get({userId:123}); // returns a single user
Users.query(); // returns a collection of all users.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With