title: Should temporary data be stored in an Angular service
body: <p>I assume, this is a very basic question, but I did not found any answer elsewhere (I think, <a href="https://stackoverflow.com/questions/45723173/angular-v4-do-we-store-data-in-a-service-or-the-component-or-both">this</a> goes in the same direction).</p>
  
  <p>I wonder, if an Angular (2 or 4) service should hold any temporary data.</p>
  
  <p>To illustrate my question, lets assume within the <a href="https://angular.io/tutorial/toh-pt4" rel="nofollow noreferrer">Tour of Heroes</a>, after having fetched the heroes once, I want to be able to search within them without an API-call.</p>
  
  <p>I wonder, if it would make sense to add a <code>loadAndGetHeroes(heroListId)</code>-method to the service, which returns the list, but also saves the list within a private field in the service.</p>
  
  <p>Then I could add a <code>searchForHeroPattern(pattern)</code>-method to the service, which does not need an API call but can search on the client and would also be available for other parts of the angular-app.</p>
  
  <p>Is this an intended approach or is there a better way to implement such things?</p>