docs: update and edit web-worker page (#36383)

PR Close #36383
This commit is contained in:
Judy Bogart 2020-03-11 10:14:10 -07:00 committed by Kara Erickson
parent 24a92472bf
commit 4d458db1b5

View File

@ -4,7 +4,7 @@
freeing the main thread to update the user interface. freeing the main thread to update the user interface.
If you find your application performs a lot of computations, such as generating CAD drawings or doing heavy geometrical calculations, using web workers can help increase your application's performance. If you find your application performs a lot of computations, such as generating CAD drawings or doing heavy geometrical calculations, using web workers can help increase your application's performance.
<div class="alert is-helpful> <div class="alert is-helpful">
The CLI does not support running Angular itself in a web worker. The CLI does not support running Angular itself in a web worker.
@ -19,9 +19,6 @@ To add a web worker to an existing project, use the Angular CLI `ng generate` co
You can add a web worker anywhere in your application. You can add a web worker anywhere in your application.
For example, to add a web worker to the root component, `src/app/app.component.ts`, run the following command. For example, to add a web worker to the root component, `src/app/app.component.ts`, run the following command.
`ng generate web-worker app`.
The command performs the following actions. The command performs the following actions.
- Configures your project to use web workers, if it isn't already. - Configures your project to use web workers, if it isn't already.
@ -52,7 +49,7 @@ The command performs the following actions.
After you generate this initial scaffold, you must refactor your code to use the web worker by sending messages to and from the worker. After you generate this initial scaffold, you must refactor your code to use the web worker by sending messages to and from the worker.
<div class="alert is-important> <div class="alert is-important">
Some environments or platforms, such as `@angular/platform-server` used in [Server-side Rendering](guide/universal), don't support web workers. To ensure that your application will work in these environments, you must provide a fallback mechanism to perform the computations that the worker would otherwise perform. Some environments or platforms, such as `@angular/platform-server` used in [Server-side Rendering](guide/universal), don't support web workers. To ensure that your application will work in these environments, you must provide a fallback mechanism to perform the computations that the worker would otherwise perform.