With over 30 inputs on a single page, each input triggers a callback on ng-blur
(when focus is lost) that calls a remote API using the $http
AngularJS service. These API requests run asynchronously in parallel, allowing users to edit inputs multiple times with each ng-blur
event sending data to the server.
At the bottom of the page, there is a "next" button that users press when they are finished editing the inputs. How can we prevent users from pressing the "next" button until all API PUT promises have been completed? Additionally, what should be done if some HTTP requests fail due to a server error (e.g., 500 status code)?