angularjs simple .then or $q service in async requests
I don't know what is the exactly difference between AngularJS $q service and simply using .then() after async request. Simple example with .then() : function InboxService($http) { this.getEmails = function getEmails() { return $http.get('/emails'); }; } And when using the service (just part of code): InboxService.getEmails() .then(function (response) { // use response }); What is the difference with $q service with resolve and reject ? What is the difference with $q service with resolve and reject ? I assume you are asking about the usage of var deferred = $q.defer() with subsequent deferred