I would like to create some "repositories", and add a base url to all request but only for that repository.
angular.module('user', [])
.service('User', function ($http) {
// SOMETHING LIKE THIS
$http.setBaseUrl('/api/v1/users');
this.index = function () {
// CALL TO api/v1/users/
return $http('/');
}
});
I know there is the $httpProvider and I could add there the interceptors, but it will add to ALL REQUESTS and that's not I want.
What can I do?