AngularJS $q

The use of promises, why we need them. Firstly, we use promises to avoid nesting requests inside other requests callback functions. Requests are often nested so we do not return data before all calls have been made. Taking an example of a file sharing service, where there are users, and…