
angular.module("myApp").factory('News', function ($resource) {
       return $resource('http://localhost:8080/api/news/:id', {id: '@myNewsId'},{
           'get': {
               method: 'GET',
               isArray: false
           }
       });
    });

angular.module('myApp').factory('Catagories', function ($resource) {
        return $resource('http://localhost:8080/api/catalogies/:id', {id: '@myCatagoriesId'});
    });

angular.module('myApp').factory('LatestNews', function ($resource) {
    return $resource('http://localhost:8080/api/catalogi/:id/latestNews', {id: '@CatagoriesId'},{
        'get': {
            method: 'GET',
            isArray: true
        }
    });
});

angular.module('myApp').factory('NewsByCatagori', function ($resource) {
    return $resource('http://localhost:8080/api/catalogi/:id/news', {id: '@catagoriesId'},{
        'get': {
            method: 'GET',
            isArray: true
        }
    });
});

