title: What is stateful filtering in AngularJS?
body: <p>I was reading the AngularJS developer guide on the Filter section (<a href="https://docs.angularjs.org/guide/filter#stateful-filters" rel="noreferrer">https://docs.angularjs.org/guide/filter#stateful-filters</a>) and came across "Stateful Filters". </p>
  
  <p>This description is given as follows:</p>
  
  <blockquote>
    <p>It is strongly discouraged to write filters that are stateful, because the execution of those can't be optimized by Angular, which often leads to performance issues. Many stateful filters can be converted into stateless filters just by exposing the hidden state as a model and turning it into an argument for the filter.</p>
  </blockquote>
  
  <p>I'm new to web development, so have no idea what Stateful filtering is, and Angular Documentation didn't explain it either :( Can someone please explain what is the difference between a normal filter and a stateful filter is?</p>