Skip to content
@ng-doc/app / Class

NgDocRoutePreloader

Preloads the pages that the reader is about to open, so that opening them shows them at once.

It preloads a page when the reader points at, focuses or touches a link to it, anywhere in the document: the sidebar, the previous and next page links, links in the page content, search results and the table of contents. It also preloads the previous and next pages of a guide once the browser is idle after the guide has rendered. A preload loads the code of the page's route and its content, once per page. Nothing is preloaded on the server, when the reader asked the browser to save data, or on a 2G connection.

The router loads the code through its preloading strategy, so preloading works only when the application sets NgDocPreloadingStrategy as that strategy:

Decorators
@Service
DeclarationTypeScript
@Service()
export class NgDocRoutePreloader { … }

Members

Constructor

1
()
—

Methods

2
(…): boolean

Preloads the code and the content of the page at a URL of the application. A page is preloaded once; the current page is not preloaded.

(…): void

Preloads pages once the browser is idle. A later call replaces the pages of an earlier one that has not run yet.

Symbol
Kind
Class
Decorators
@Service
Scope
@ng-doc/app
Edit this page