Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- /**
- * Factory service to handle API request
- */
- angular.module('newsApp')
- .factory('Categories', ['API', '$resource',
- function(API, $resource) {
- var API_ENDPOINT = API.url + API.endpoint.categories;
- var categories = $resource(
- API_ENDPOINT + ':id', {
- id: "@_id"
- }, {
- update: {
- method: 'PUT' // this method issues a PUT request
- }
- })
- return categories;
- }
- ]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement