Skip to content

Instantly share code, notes, and snippets.

@pzaich
Created November 13, 2014 18:22
Show Gist options
  • Select an option

  • Save pzaich/dfd8dd0596deaf3ec029 to your computer and use it in GitHub Desktop.

Select an option

Save pzaich/dfd8dd0596deaf3ec029 to your computer and use it in GitHub Desktop.
configure camelize under_underscore translation
.config(function (RestangularProvider) {
RestangularProvider.addResponseInterceptor(function (data, operation, what, url, response, deferred) {
return humps.camelizeKeys(data);
});
RestangularProvider.addRequestInterceptor(function (data, operation, what, url, response, deferred) {
return humps.decamelizeKeys(data);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment