$resource(url, [paramDefaults], [actions], options)
$resource(url, [paramDefaults], [actions], options)
A parameterized URL template with parameters prefixed by : as in /user/:username. If you are using a URL with a port number (e.g. http://example.com:8080/api), it will be respected.
Default values for url parameters. These can be overridden in actions methods. If any of the parameter value is a function, it will be executed every time when a param value needs to be obtained for a request (unless the param was overridden).
Hash with declaration of custom actions that should extend the default set of resource actions.
Hash with custom settings that should extend the default $resourceProvider behavior. The only supported option is Where:
A resource "class" object with methods for the default set of resource actions optionally extended with custom actions
Resource - A factory which creates a resource object that lets you interact with RESTful server-side data sources.
https://code.angularjs.org/1.4.2/docs/api/ngResource/service/$resource