Skip to content

Instantly share code, notes, and snippets.

@av1v3k
Last active September 26, 2025 01:17
Show Gist options
  • Select an option

  • Save av1v3k/8019c85f99915db32d2e8d1dbb702644 to your computer and use it in GitHub Desktop.

Select an option

Save av1v3k/8019c85f99915db32d2e8d1dbb702644 to your computer and use it in GitHub Desktop.
How to declare global window object in Angular ?
// 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