diff --git a/modules/@angular/platform-browser/src/web_workers/shared/post_message_bus.ts b/modules/@angular/platform-browser/src/web_workers/shared/post_message_bus.ts index d56e45790f..db42fe6899 100644 --- a/modules/@angular/platform-browser/src/web_workers/shared/post_message_bus.ts +++ b/modules/@angular/platform-browser/src/web_workers/shared/post_message_bus.ts @@ -66,7 +66,8 @@ export class PostMessageBusSource implements MessageBusSource { eventTarget.addEventListener("message", (ev: MessageEvent) => this._handleMessages(ev)); } else { // if no eventTarget is given we assume we're in a WebWorker and listen on the global scope - addEventListener("message", (ev: MessageEvent) => this._handleMessages(ev)); + const workerScope = self; + workerScope.addEventListener("message", (ev: MessageEvent) => this._handleMessages(ev)); } }