routerProvidersHash top-level constant

const routerProvidersHash = const [const Provider(LocationStrategy, useClass: HashLocationStrategy), const Provider(PlatformLocation, useClass: BrowserPlatformLocation), const Provider(Location), const Provider(Router, useClass: RouterImpl)]

The main Router providers when using hash routing.

The routerProvidersHash should be added to the providers during the main app's bootstrap.

bootstrap(MyAppComponent, [routerProvidersHash]);

Implementation

const routerProvidersHash = [
  Provider(LocationStrategy, useClass: HashLocationStrategy),
  Provider(PlatformLocation, useClass: BrowserPlatformLocation),
  Provider(Location),
  Provider(Router, useClass: RouterImpl)
]