routerProviders top-level constant

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

The main Router providers.

The routerProviders should be added to the app's root injector.

@GenerateInjector([routerProviders])
final InjectorFactory appInjector = ng.appInjector$Injector;
...
runApp(ng.MyAppComponentNgFactory, createInjector: appInjector);

Implementation

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