Created
September 10, 2014 05:14
-
-
Save nirvanatikku/11a9eb7aa063e5aef097 to your computer and use it in GitHub Desktop.
Leveraging Angular's $http service from Backbone
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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