title: Angular services: singleton, non-singleton, lazy loaded and ngrx. How to provide them?
body: <p>I am trying to get my head around the different ways of declaring services in Angular applications and when to use which, and also how to deal with store slices via ngrx.</p>
  
  <p>In Angular 6, the recommended approach is to use providedIn: 'root' for singleton services: <a href="https://angular.io/guide/singleton-services" rel="nofollow noreferrer">https://angular.io/guide/singleton-services</a>
  This way they will be tree-shakeable and only 1 instance will be created when the app bootstraps. </p>
  
  <p>What I don't understand is:</p>
  
  <ul>
  <li><p>Is there any use for non-singleton services at all? 
  I understand that you can add services to the list of providers of a component, and a new instance of the services will be created whenever the component is created, and destroyed when the component is destroyed. The advantage I see is the memory release, but on the other hand the Angular team doesn't mention this at all and it recommends to provide the services in the root module.</p></li>
  <li><p>Is there any case in which providing the service in a feature module makes more sense that in the root injector? 
  As I understand it, if instead of 'root' you select another module, the service will be created when this module is loaded. This seems to make sense for lazy-loaded modules, to avoid having to load services you don't need on bootstrap. If I try to do this with a module that is using ngrx, I get a warning for a circular dependency, as the Admin effects need to import the Admin service, and the Admin service is defined as providedIn: 'AdmimModule'. What am I doing wrong?
  I also get a circular dependency as it follows:
  AdminRoutingModule -> AdminComponent -> AdminService -> AdminModule -> AdminRoutingModule</p></li>
  </ul>
  
  <p>Also, is there any space for static methods? It seems to me that all methods of singleton service could be declared as static. I have read static methods are harder to test, is this the only reason not to use them?</p>