What is $q service, deferred and promises ? By in on Feb 03 2018 • Jan, 2020 20 When we want to send multiple requests/functions parallely or asynchronously we can use$q services.
for example
$q.all(request1,request2).then(function (response) {result1 = response[0];result2 = response[1];}) Promises are provided by$q service. Promise is a placeholder for the values we will get in return from the requests/ functions we have used in \$q services.

Deferred object is to expose the results from Promise. there are some methods we can use to resolve the promise values i.e. resolve() and reject(). If there is some error in the values of the Promise we can call reject() method.