• Overview
@angular/router

RouterPreloader

Class

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

API

  
    class RouterPreloader implements OnDestroy {}
  
  

setUpPreloading

void
@returnsvoid

preload

Observable<any>
@returnsObservable<any>

ngOnDestroy

void
@returnsvoid

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