function
Allows to configure a preloading strategy to use. The strategy is configured by providing a reference to a class that implements a PreloadingStrategy
.
withPreloading(preloadingStrategy: Type<PreloadingStrategy>): PreloadingFeature
preloadingStrategy | Type<PreloadingStrategy> | A reference to a class that implements a |
PreloadingFeature
: A set of providers for use with provideRouter
.
Basic example of how you can configure preloading:
const appRoutes: Routes = []; bootstrapApplication(AppComponent, { providers: [ provideRouter(appRoutes, withPreloading(PreloadAllModules)) ] } );
© 2010–2023 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://angular.io/api/router/withPreloading