title: then(function) not getting updated with returned promise value in angularjs
body: <p>I am trying to to get some data from API with the help of promises in angularjs. I have one service which is getting a value from API and returning the promise to controller.</p>
  
  <pre><code>***Service***
  this.forgotPasswordLink = function(email){
      var deferred = $q.defer();
      $http.post('/forgotPassword',{
          email: email 
      }).success(function(response){
          console.log("the new response is: ",response);
          deferred.resolve(response);
      }).error(function(error){
          deferred.reject(error);
      });
      return deferred.promise;
  };
  
  **Controller**
  authService.forgotPasswordLink($scope.forgotPasswordEmail).then(function(data){
          console.log(data);
          if(data.message === 'emailFound'){
              $scope.emailSent = true;
              $scope.emailNotSent = false;
          }
          else{
              $scope.emailNotSent = true;
              $scope.emailSent = false;
          }
      });
  </code></pre>
  
  <p>Here authservice is the name of the service . so this code is working fine but the problem is when I try to get data multiple times one after the other, for the first time promise is returning the correct data but when I try to post with different data, promise doesn't updates the then(function) even though promise gets proper response from server.</p>
  
  <p>if you see there are two console statements, one in service and one in controller; so the console statement in controller is getting executed first as promise is returning the old value and when promise is resolving, second console statement which is in service is executed with the updated value.</p>
  
  <p>So how do I get the updated value in then(function). do I need to refresh the service after posting the data once.</p>