title: Angular JS cancel $http call before calling a new $http
body: <p>In angular JS 1.1.5 you can cancel previously started $http calls. These two <a href="https://stackoverflow.com/questions/16962232/in-angularjs-how-to-stop-ongoing-http-calls-on-query-change">link1</a> and <a href="https://stackoverflow.com/questions/13928057/how-do-to-cancel-an-http-request-in-angularjs">link2</a> gives some explanation on how it works.</p>
  
  <p>However I can't understand, how to use this in practice. I created <a href="http://plnkr.co/edit/j6CV187kQdG6JdEclTyr" rel="nofollow noreferrer">plnkr</a> to illustrate what I want to achieve.</p>
  
  <ol>
  <li>User has a link he can click on (as we know, users tend to do that very passionately)</li>
  <li>If user clicks link, and previous request hasn't yet finished, it should be canceled, and new request should be made (in this example there are other ways to ignore multiple clicks. Original problem is user input field with ng-change on it - request gets made every time user changes value - every keypress will fire $http. I'm using link to make it a bit simpler)</li>
  </ol>
  
  <p>As you can see in <a href="http://plnkr.co/edit/j6CV187kQdG6JdEclTyr" rel="nofollow noreferrer">plnkr</a> request fires and gets canceled immediately, but I'm expecting last request to succeed.</p>
  
  <p>I'm new to angularjs so probably I'm doing it wrong. I've gooled everything I can imagine, but there are no full examples for canceler.resolve()</p>
  
  <p>Can anyone help me with this or guide me to right direction?</p>