angular-cn/aio/dist/generated/docs/api/service-worker.json

5 lines
8.5 KiB
JSON
Raw Permalink Normal View History

{
"id": "api/service-worker",
"title": "@angular/service-worker",
"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/service-worker\", \"name\": \"@angular/service-worker\" } }\n ]\n }\n </script>\n <a href=\"/api\">API</a>\n </div>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/packages/service-worker/PACKAGE.md?message=docs(...)%3A%20describe%20your%20change...\" 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/service-worker/PACKAGE.md\" 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=\"angularservice-worker\">@angular/service-worker<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/service-worker#angularservice-worker\"><i class=\"material-icons\">link</i></a></h1>\n <label class=\"api-type-label package\">package</label>\n \n \n \n</header>\n\n <aio-toc class=\"embedded\"></aio-toc>\n\n <div class=\"api-body\">\n <p>Implements a service worker for Angular apps.\nAdding a service worker to an Angular app is one of the steps for turning it into a Progressive Web App (also known as a PWA).</p>\n\n <p>At its simplest, a service worker is a script that runs in the web browser and manages caching for an application.\nService workers function as a network proxy. They intercept all outgoing HTTP requests made by the application and can choose how to respond to them.</p>\n<p>To set up the Angular service worker in your project, use the CLI <code>add</code> command.</p>\n<code-example>\nng add @angular/pwa\n</code-example>\n<p>The command configures your app to use service workers by adding the service-worker package\nand generating the necessary support files.</p>\n<p>For more usage information, see the <a href=\"guide/service-worker-intro\">Service Workers</a> guide.</p>\n\n\n \n\n\n \n <h2 id=\"entry-points\">Entry points<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/service-worker#entry-points\"><i class=\"material-icons\">link</i></a></h2>\n \n \n \n <section class=\"export-list\">\n <h3 id=\"primary\">Primary<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/service-worker#primary\"><i class=\"material-icons\">link</i></a></h3>\n <table class=\"is-full-width list-table\">\n \n <tbody><tr>\n <td><code class=\"code-anchor\"><a href=\"api/service-worker#primary-entry-point-exports\">@angular/service-worker</a></code></td>\n <td>\n \n <p>Implements a service worker for Angular apps.\nAdding a service worker to an Angular app is one of the steps for turning it into a Progressive Web App (also known as a PWA).</p>\n\n </td>\n </tr>\n \n </tbody></table>\n </section>\n \n\n \n \n \n\n \n\n <h2 id=\"primary-entry-point-exports\">Primary entry point exports<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/service-worker#primary-entry-point-exports\"><i class=\"material-icons\">link</i></a></h2>\n \n \n \n \n \n <section class=\"export-list\">\n <h3 id=\"ngmodules\">NgModules<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/service-worker#ngmodules\"><i class=\"material-icons\">link</i></a></h3>\n <table class=\"is-full-width list-table\">\n \n <tbody><tr>\n <td><
}