note.js 628 B

1234567891011121314151617181920
  1. /*
  2. There are 5 types of services:
  3. * Factory: most common. Used to share functions and objects across an app.
  4. * Value: often used, just share a value
  5. * Provider: common. Like factory, but with configuration
  6. * Constant: rarely used, to share a value within app configuration.
  7. * Service: rarely used, a ServiceService recipe (?) to share instances of methods and objects.
  8. */
  9. angular.module("noteWrangler")
  10. // Naming the function <service>Factory is a common convention.
  11. .factory('Note', function NoteFactory($resource) {
  12. return $resource("/notes/:id", {}, {
  13. update: {
  14. method: "PUT",
  15. }
  16. });
  17. });