If you encounter a similar issue, Restangular allows you to create a separate service with custom configuration options different from the global settings. The example below, taken from the Restangular GitHub page, demonstrates how this can be done:
// Global configuration
app.config(function(RestangularProvider) {
RestangularProvider.setBaseUrl('http://www.google.com');
RestangularProvider.setRequestSuffix('.json');
});
// Customized Restangular service for Bing
app.factory('BingRestangular', function(Restangular) {
return Restangular.withConfig(function(RestangularConfigurer) {
RestangularConfigurer.setBaseUrl('http://www.bing.com');
});
});
// Implementation in a controller
app.controller('MainCtrl', function(Restangular, BingRestangular) {
// Retrieve data from http://www.google.com/users.json
// Using global configuration
Restangular.all('users').getList()
// Retrieve data from http://www.bing.com/users.json
// Applying custom Bing configuration based on the global settings
BingRestangular.all('users').getList()
});