Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. 'use strict';
  2.  
  3. /**
  4. * Factory service to handle API request
  5. */
  6.  
  7. angular.module('newsApp')
  8. .factory('Categories', ['API', '$resource',
  9. function(API, $resource) {
  10. var API_ENDPOINT = API.url + API.endpoint.categories;
  11.  
  12. var categories = $resource(
  13. API_ENDPOINT + ':id', {
  14. id: "@_id"
  15. }, {
  16. update: {
  17. method: 'PUT' // this method issues a PUT request
  18. }
  19. })
  20.  
  21. return categories;
  22. }
  23. ]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement