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 as that strategy:
provideRouter (routes, withPreloading (NgDocPreloadingStrategy ));- Decorators
@Service
@Service ()
export class NgDocRoutePreloader { … }Members
Constructor1 | |||||||
() | — | ||||||
Signature | |||||||
Methods2 | |||||||
(…): 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. | ||||||
Signature Parameters
Returns boolean -Whether a preload started. | |||||||
(…): void | Preloads pages once the browser is idle. A later call replaces the pages of an earlier one that has not run yet. | ||||||
Signature Parameters
Returns void | |||||||