routerProviders top-level constant

List<ClassProvider<Object>> const routerProviders

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)
];