angular-cn/aio/dist/generated/docs/api/router/RouterPreloader.json

5 lines
7.8 KiB
JSON
Raw Normal View History

{
"id": "api/router/RouterPreloader",
"title": "RouterPreloader",
"contents": "\n\n<article>\n <div class=\"breadcrumb-container\">\n <div class=\"breadcrumb\">\n <script type=\"application/ld+json\">\n {\n \"@context\": \"http://schema.org\",\n \"@type\": \"BreadcrumbList\",\n \"itemListElement\": [\n { \"@type\": \"ListItem\", \"position\": 1, \"item\": { \"@id\": \"https://angular.io//api\", \"name\": \"API\" } },\n { \"@type\": \"ListItem\", \"position\": 2, \"item\": { \"@id\": \"https://angular.io/api/router\", \"name\": \"@angular/router\" } },\n { \"@type\": \"ListItem\", \"position\": 3, \"item\": { \"@id\": \"https://angular.io/api/router/RouterPreloader\", \"name\": \"RouterPreloader\" } }\n ]\n }\n </script>\n <a href=\"/api\">API</a> > <a href=\"api/router\">@angular/router</a>\n </div>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/packages/router/src/router_preloader.ts?message=docs(router)%3A%20describe%20your%20change...#L61-L137\" aria-label=\"Suggest Edits\" title=\"Suggest Edits\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n <a href=\"https://github.com/angular/angular/tree/12.0.0-next.7/packages/router/src/router_preloader.ts#L61-L137\" aria-label=\"View Source\" title=\"View Source\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">code</i></a>\n</div>\n </div>\n \n <header class=\"api-header\">\n <h1 id=\"routerpreloader\">RouterPreloader<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/router/RouterPreloader#routerpreloader\"><i class=\"material-icons\">link</i></a></h1>\n \n <label class=\"api-type-label class\">class</label>\n \n \n \n </header>\n \n <aio-toc class=\"embedded\"></aio-toc>\n\n <div class=\"api-body\">\n \n <section class=\"short-description\">\n <p>The preloader optimistically loads all router configurations to\nmake navigations into lazily-loaded sections of the application faster.</p>\n\n <p><a href=\"api/router/RouterPreloader#description\">See more...</a></p>\n </section>\n \n \n \n <section class=\"class-overview\">\n<code-example language=\"ts\" hidecopy=\"true\">\nclass <a href=\"api/router/RouterPreloader\" class=\"code-anchor\">RouterPreloader</a> implements <a class=\"code-anchor\" href=\"api/core/OnDestroy\">OnDestroy</a> {\n <a class=\"code-anchor\" href=\"api/router/RouterPreloader#setUpPreloading\"><span class=\"member-name\">setUpPreloading</span>(): void</a>\n <a class=\"code-anchor\" href=\"api/router/RouterPreloader#preload\"><span class=\"member-name\">preload</span>(): Observable&#x3C;any></a>\n}\n</code-example>\n\n \n \n\n</section>\n\n\n \n\n \n \n<section class=\"description\">\n <h2 id=\"description\">Description<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/router/RouterPreloader#description\"><i class=\"material-icons\">link</i></a></h2>\n <p>The preloader runs in the background. When the router bootstraps, the preloader\nstarts listening to all navigation events. After every such event, the preloader\nwill check if any configurations can be loaded lazily.</p>\n<p>If a route is protected by <code>canLoad</code> guards, the preloaded will not load it.</p>\n\n \n</section>\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n<section class=\"instance-methods\">\n <h2 id=\"methods\">Methods<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/router/RouterPreloader#methods\"><i class=\"material-icons\">link</i></a></h2>\n \n <a id=\"setUpPreloading\"></a>\n<table class=\"is-full-width method-table instance-method\">\n <thead><tr><th>\n <div class=\"with-github-links\">\n <h3 id=\"setuppreloading\">\n setUpPreloading()\n \n <a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/router/RouterPreloader#setuppreloading\"><i class=\"material-icons\">link</i></a></h3>\n <div class=\"github-links\">\n <a href=\"https://githu
}