Chained promises and preserving `this`
问题 I have a click handler that needs to make several async calls, one after another. I've chosen to structure these calls using promises (RSVP, to be precise). Below, you can see the clickA handler, inside the controller (it's an Ember app, but the problem is more general, I think): App.SomeController = Ember.Controller.extend({ actions: { clickA: function() { var self = this; function startProcess() { return makeAjaxCall(url, { 'foo': self.get('foo') }); } function continueProcess(response) {