From d15a6a3a7138c277736ca011a5a6f38dc51b1b83 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Tue, 25 May 2021 10:49:53 +0200 Subject: [PATCH] docs: update web-worker syntax (#42306) With this change we update the worker initialization syntax to reflect that used in Angular CLI 12. Closes #42302 PR Close #42306 --- aio/content/guide/web-worker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aio/content/guide/web-worker.md b/aio/content/guide/web-worker.md index 8151625e98..148c4e73ae 100644 --- a/aio/content/guide/web-worker.md +++ b/aio/content/guide/web-worker.md @@ -42,7 +42,7 @@ The command performs the following actions. if (typeof Worker !== 'undefined') { // Create a new - const worker = new Worker('./app.worker', { type: 'module' }); + const worker = new Worker(new URL('./app.worker', import.meta.url)); worker.onmessage = ({ data }) => { console.log(`page got message: ${data}`); };