# Angular: How do I get a reference to the window object?

DevFeed: [Angular: How do I get a reference to the window object?](<https://devfeed.tech/articles/angular-how-do-i-get-a-reference-to-the-window-object-21297.md>)

Original publisher: [Read original article](<https://juri.dev/blog/2016/09/ng2-get-window-ref/>)

Published: 2016-09-19T00:00:00Z

Content type: tutorial

Language: en

Sources: [Juri Strumpflohner](<https://devfeed.tech/sources/juri-strumpflohner.md>)

Topics: [Angular](<https://devfeed.tech/topics/angular.md>), [Dependency injection](<https://devfeed.tech/topics/dependency-injection.md>), [browser](<https://devfeed.tech/topics/browser.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [angular](<https://devfeed.tech/tags/angular.md>), [browser](<https://devfeed.tech/tags/browser.md>), [component](<https://devfeed.tech/tags/component.md>), [dependency-injection](<https://devfeed.tech/tags/dependency-injection.md>), [providers](<https://devfeed.tech/tags/providers.md>)

## AI overview

This tutorial explains how to access the browser window object in Angular applications by wrapping it in an injectable service and registering that service as a provider. The approach supports applications running in different environments, including browsers, servers, and web workers.

## Source excerpt

Lorem ipsum dolor sit amet