Skip to content

Instantly share code, notes, and snippets.

@nirvanatikku
Created September 10, 2014 05:14
Show Gist options
  • Save nirvanatikku/11a9eb7aa063e5aef097 to your computer and use it in GitHub Desktop.
Save nirvanatikku/11a9eb7aa063e5aef097 to your computer and use it in GitHub Desktop.
Leveraging Angular's $http service from Backbone
// For those using Backbone within an Angular application
Backbone.ajax = function(arg){
var success = arg.success;
var error = arg.error;
arg.method = arg.type;
return $http(arg)
.success(success)
.error(error);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment