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 answers

hi 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

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -