javascript - return statement returning before finishing the task -
javascript - return statement returning before finishing the task -
this question has reply here:
how homecoming response asynchronous call? 11 answershi using kill function in application, here calling kill function within loop each time homecoming d each iteration
but times getting d value before completion of d.done() , after returning d calling d.done() body please suggest me concept have utilize here
kill: function() { var t = , url = "my url"//app.data.url('user', p.get('id'), 'dissociate_tag', id) , d = _.http.del(url); d.done(function() { t.resettile(); t.set('killed', true); }); homecoming d; }
you give done
callback method, called when it's finished, d returned before method passed done
called.
the trick have code calls kill
wait on d finish (if it's of import it's finished before continues)
javascript ember.js
Comments
Post a Comment