lundi 18 janvier 2016

Ember.RSVP.Promise with sync

Is it possible to pass async as false for Ember.RSVP.Promise ?

var promise = new Ember.RSVP.Promise(function(resolve, reject) {
return $.ajax({
    url: requestUrl,
    type: 'POST',
    dataType: 'JSON', 
    contentType: 'application/json; charset=utf-8',
    data: JSON.stringify(postData)
}).success(resolve).error(reject);

I mean similar to how we can set when using Ember.$.ajax

var ajaxReq = Ember.$.ajax({
    url: "/someService",
    data: data,
    type: 'post',
    dataType: 'json',
    async: false,
    contentType: 'application/json'
});




Aucun commentaire:

Enregistrer un commentaire