Last active
September 26, 2025 01:17
-
-
Save av1v3k/8019c85f99915db32d2e8d1dbb702644 to your computer and use it in GitHub Desktop.
How to declare global window object in Angular ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // effects.ts declare as below, | |
| declare global { | |
| interface Window { | |
| dataLayer: any[]; | |
| } | |
| } | |
| ============== | |
| //Then, in effects.ts, it can be used as, | |
| window.dataLayer.push({ | |
| event: '', | |
| event_parameters: { | |
| title: '', | |
| description: '' | |
| } | |
| ... | |
| ... | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment