title: Turn off Angular 5 routing
body: <p>We are working on a SPA. In some situations, one part of it is rendered into another application (as part of the markup).
  In this situations, we don't want routing in our application because we could possibly "steal" it from the other application.
  Is it somehow possible, to "turn off" routing in Angular at all? Or ignoring unknown routes?</p>
  
  <p>I tried</p>
  
  <ul>
  <li>router.resetConfig with an empty configuration > 
  "Cannot match any route"-Error appeared.</li>
  <li>using a CanActivate guard on a solely wildcard-route, which always returns false -> same problem</li>
  <li>using a CanLoad-Guard on a solely wildcard-route -> this seems to work, when not using #-routing. But we are using #-routing and because of AOT I haven't found a way to switch the useHash-Value at runtime.</li>
  </ul>
  
  <p>What is working is, to completely remove the RouteModule.forRoot(...)-Import - but of course in that case, the rest of the application is totally broken.</p>
  
  <p>This is one try with the CanLoad-Guard:</p>
  
  <pre><code>const routes: Routes = [
      // ...
      { path: "", redirectTo: "home", pathMatch: "full" },
      { path: "**", redirectTo: "home" }
  ];
  
  @NgModule({
      declarations: [],
      imports: [RouterModule.forRoot(routes, { useHash: true,     initialNavigation: false })],
      exports: [RouterModule],
      providers: [{
          provide: "DisableRouting",
          useValue: () =&gt; false
      }]
  })
  export class AppRoutingModule {
      constructor(@Inject("HEADER_RENDER_MODE") private headerRenderMode: boolean, private router: Router) {
          if (!headerRenderMode) {
              router.initialNavigation();
          } else {
              // we don't want routing at this point
              router.resetConfig([{
                      path: "**",
                      component: HomeComponent,
                      canLoad: ["DisableRouting"]
                  }]);
          }
      }
  }
  </code></pre>