routerProviders top-level constant

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

The main Router providers.

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

bootstrap(MyAppComponent, [routerProviders]);

Implementation

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