Skip to content

Instantly share code, notes, and snippets.

@thecodejack
Forked from knownasilya/rsvpAjax.js
Last active December 31, 2015 00:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thecodejack/7908413 to your computer and use it in GitHub Desktop.
Save thecodejack/7908413 to your computer and use it in GitHub Desktop.
var ajaxPromise = function(url, options){
return Ember.RSVP.Promise(function(resolve, reject) {
var options = options || {};
options.success = function(data){
resolve(data);
};
options.error = function(jqXHR, status, error){
reject(arguments);
};
Ember.$.ajax(url, options);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment