title: What's a 'deferred' in $q?
body: <p>I have read every article on $q out there but somehow I am unable to grasp it. For example take the best <a href="http://www.webdeveasy.com/javascript-promises-and-angularjs-q-service/" rel="nofollow noreferrer">article</a> I found. I get as far as:</p>
  
  <pre><code>var myFirstDeferred = $q.defer(); //Actually I don't even get this far
  </code></pre>
  
  <blockquote>
    <p>A deferred represents the result of an asynchronic operation. It exposes an interface that can be used for signaling the state and the result of the operation it represents. It also provides a way to get the associated promise instance. </p>
  </blockquote>
  
  <p>What's a 'deferred'? How is it different from a promise? Then we get to this: </p>
  
  <pre><code>async(function(value) {  
      myFirstDeferred.resolve(value);
  }, function(errorReason) {
      myFirstDeferred.reject(errorReason);
  });
  </code></pre>
  
  <p>I have NO idea what this is doing. I want to stress that I understand async. I understand the promise structure. For example I know exactly what the code below is doing:</p>
  
  <pre><code>$http.get(url)
      .then(function(result){returnresult}
       ,function(error){return error})
  </code></pre>
  
  <p>But what are we doing with the deferred in the object above? Why even have the deferred at all? Why not just the then block?</p>
  
  <p>Edit: I want to stress that I went through a ton of replies here, as well as the articles. I thought the point of $q was the force the execution of an async call (kind of like "await" in c#) and then perform some code after. I really don't understand how it does that. I do get how the .all command works when waiting for multiple async operations in this <a href="https://stackoverflow.com/questions/18673890/angularjs-promises-q-defer">example</a>, but not with one. </p>
  
  <p>Edit: This edit is in response to the <a href="https://stackoverflow.com/questions/6801283/what-are-the-differences-between-deferred-promise-and-future-in-javascript">duplicate suggestion</a> - I disagree with the notion. For one, this question is more focused and limited in scope. In addition, the answer accepted here clarifies far better (imo) than the wide-net answer in the other q. </p>