[ Web Proxy ]
URL:
Viewing: https://angular.dev/api/router/RouterPreloader [Back]  [Original]

RouterPreloader Angular Skip to main content
menu
close
more_horiz
menuAPI
@angular/router

RouterPreloader

Class
stable

The preloader optimistically loads all router configurations to make navigations into lazily-loaded sections of the application faster.

On this page

    arrow_upward_alt Back to the top

    API

        
          class RouterPreloader implements OnDestroy {  constructor(router: Router, injector: EnvironmentInjector, preloadingStrategy: PreloadingStrategy, loader: RouterConfigLoader);  setUpPreloading(): void;  preload(): Observable<any>;}
        
        

    constructor

    RouterPreloader
    @paramrouterRouter
    @paraminjectorEnvironmentInjector
    @parampreloadingStrategyPreloadingStrategy
    @paramloaderRouterConfigLoader

    setUpPreloading

    void
    @returnsvoid

    preload

    Observable<any>
    @returnsObservable<any>

    Description

    The preloader optimistically loads all router configurations to make navigations into lazily-loaded sections of the application faster.

    The preloader runs in the background. When the router bootstraps, the preloader starts listening to all navigation events. After every such event, the preloader will check if any configurations can be loaded lazily.

    If a route is protected by canLoad guards, the preloaded will not load it.

    Jump to details

    Web Proxy Viewer  |  New URL  |  Original Page