Multiple routing urls for single service AngularJS

I have multiple URL paths that I would like to map to a single resource. However I am unsure how to change the URL based on the function called. For example the :dest mapping for query would be /allProducts, however destroy would be something along the lines of /delete/:id

service.factory('ProductsRest', ['$resource', function ($resource) {
    return $resource('service/products/:dest', {}, {
        query: {method: 'GET', params: {}, isArray: true },
        save: {method: 'POST'},
        show: { method: 'GET'},
        edit: { method: 'GET'},
        update: { method: 'PUT'},
        destroy: { method: 'DELETE' }
    });
}]);

I just needed to put the url in as the param.

service.factory('ProductsRest', ['$resource', function ($resource) {
    return $resource('service/products/:dest', {}, {
        query: {method: 'GET', params: {dest:"allProducts"}, isArray: true },
        save: {method: 'POST', params: {dest:"modifyProduct"}},
        update: { method: 'POST', params: {dest:"modifyProduct"}},
    });
}]);

For each action you can override the url argument. Specially for this is the url: {...} argument.

In your example:

service.factory('ProductsRest', ['$resource', function ($resource) {
    return $resource('service/products/', {}, {
        query: {method: 'GET', params: {}, isArray: true },
        save: {method: 'POST', url: 'service/products/modifyProduct'},
        update: { method: 'PUT', url: 'service/products/modifyProduct'}
    });
}]);

I have found a good tutorial how to use different urls. Have not tested yet, but I guess it must work!!!

http://www.bennadel.com/blog/2433-Using-RESTful-Controllers-In-An-AngularJS-Resource.htm