填写这份《一分钟调查》,帮我们(开发组)做得更好!去填写Home

RouterPreloader

预加载器会乐观加载所有路由器配置,以使导航到应用程序的惰性加载部分的速度更快。

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

查看"说明"...

      
      class RouterPreloader implements OnDestroy {
  setUpPreloading(): void
  preload(): Observable<any>
}
    

说明

预加载器在后台运行。路由器引导时,预加载器开始监听所有导航事件。在每个此类事件之后,预加载器将检查是否可以惰性加载任何配置。

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.

如果路由受 canLoad 保护器保护,则预加载的路由不会加载该路由。

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

方法

      
      setUpPreloading(): void
    
参数

没有参数。

返回值

void

      
      preload(): Observable<any>
    
参数

没有参数。

返回值

Observable<any>