title: Custom RouteReuseStrategy for Angular's child module
body: <p>I want to use this custom route reuse strategy for just one module:</p>
  
  
  
  <pre class="lang-js prettyprint-override"><code>export class CustomRouteReuseStrategy extends RouteReuseStrategy {
      public shouldDetach(route: ActivatedRouteSnapshot): boolean { return false; }
      public store(route: ActivatedRouteSnapshot, detachedTree: DetachedRouteHandle): void {}
      public shouldAttach(route: ActivatedRouteSnapshot): boolean { return false; }
      public retrieve(route: ActivatedRouteSnapshot): DetachedRouteHandle { return null; }
      public shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean {
          return true;
      }
  }
  </code></pre>
  
  <p>So I've passed into @NgModule() in one of my modules named <code>ChildModule</code>:</p>
  
  <pre class="lang-js prettyprint-override"><code>providers: [
          {
              provide: RouteReuseStrategy,
              useClass: CustomRouteReuseStrategy
          }
  ]
  </code></pre>
  
  <p>Unfortunately, when I pass it there it simply gets ignored. Although works fine when added to my root <code>AppModule</code>... I'm not sure if it matters, but <code>ChildModule</code> is lazily loaded. How to solve it?</p>