title: How to limit response size for $http service?
body: <p>I have a Spring controller that returns data in JSON format and AngularJS web app that consumes the data from it. Sometimes the amount of data is so big that it crashes the page without even finishing the request.</p>
  
  <p>That's why I would like to limit the response in size, so I would be able to cancel the request and show the correct error message if necessary. How can I do this?</p>