# Help with Tago.io Custom Widget in Angular

**URL:** <https://community.tago.io/t/help-with-tago-io-custom-widget-in-angular/1766>\
**Category:** Support\
**Created:** [September 30, 2025, 9:37pm UTC](https://community.tago.io/t/help-with-tago-io-custom-widget-in-angular/1766 "2025-09-30T21:37:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jd8086](https://avatars.discourse-cdn.com/v4/letter/j/ba9def/32.png) [@jd8086](https://community.tago.io/u/jd8086)\
**Post date:** [September 30, 2025, 9:37pm UTC](https://community.tago.io/t/help-with-tago-io-custom-widget-in-angular/1766/1 "2025-09-30T21:37:30Z")

</div>

Hi. I’m trying to use Angular to develop a custom widget for [Tago.IO](http://Tago.IO) using VSCode and have a sample ([non-Tago.IO](http://non-Tago.IO)) Angular app compiling & running OK. I also have the @tago-io/custom-widget node module installed in a simple Angular app, but I’ve been unable to get past the following issue: When I import “@tago-io/custom-widget” I always get the following error at runtime:

ReferenceError: window is not defined  
at eval (/…/NgHello1/.angular/cache/20.2.1/NgHello1/vite/deps\_ssr/@tago-io\_custom-widget.js:333:5)  
at eval (/…/NgHello1/.angular/cache/20.2.1/NgHello1/vite/deps\_ssr/@tago-io\_custom-widget.js:498:5)  
at eval (/…/NgHello1/.angular/cache/20.2.1/NgHello1/vite/deps\_ssr/@tago-io\_custom-widget.js:499:3)  
at async ESModulesEvaluator.runInlinedModule (file:///…/NgHello1/node\_modules/vite/dist/node/module-runner.js:910:3)

How does one handle the global ‘window’ object for [Tago.io](http://Tago.io) custom widgets with Angular? Also, are there any good examples (or code skeletons) of how to write a custom widget for [Tago.io](http://Tago.io) in Angular available somewhere?

Thanks again for the community support!

---

<div class="post-metadata">

**Author:** ![jd8086](https://avatars.discourse-cdn.com/v4/letter/j/ba9def/32.png) [@jd8086](https://community.tago.io/u/jd8086)\
**Post date:** [October 1, 2025, 2:20am UTC](https://community.tago.io/t/help-with-tago-io-custom-widget-in-angular/1766/2 "2025-10-01T02:20:55Z")

</div>

With a lot more Google searching, I think I solved my issue here: The problem was my Angular app skeleton had server-side rendering (SSR) enabled so the browser’s global ‘window’ object was not available on the server side. I switched it to static output mode with client-side rendering (no SSR) and it seems to be starting to work now.

---

<div class="post-metadata">

**Author:** ![gustavo.aguiar](https://yyz2.discourse-cdn.com/flex034/user_avatar/community.tago.io/gustavo.aguiar/32/1626_2.png) [@gustavo.aguiar](https://community.tago.io/u/gustavo.aguiar)\
**Post date:** [October 2, 2025, 12:11pm UTC](https://community.tago.io/t/help-with-tago-io-custom-widget-in-angular/1766/3 "2025-10-02T12:11:55Z")

</div>

Hi @jd8086

I’m glad to hear you were able to solve the issue!  
At the moment we don’t have examples of custom widgets in Angular — most of our docs and samples are in React. But if you make progress with Angular and feel like sharing, it could definitely help other developers too.

---

<div class="post-metadata">

**Author:** ![jd8086](https://avatars.discourse-cdn.com/v4/letter/j/ba9def/32.png) [@jd8086](https://community.tago.io/u/jd8086)\
**Post date:** [October 3, 2025, 1:56am UTC](https://community.tago.io/t/help-with-tago-io-custom-widget-in-angular/1766/4 "2025-10-03T01:56:10Z")

</div>

Thanks Gustavo. It may take me as while as this is just a “spare time” side project, but if I eventually succeed I hope to publish a usable Angular skeleton for custom [Tago.io](http://Tago.io) widgets and perhaps a generally useful custom widget or two based on the skeleton.
