top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How Do You Explicitly Set A New Property On `Window` In TypeScript?

+1 vote
654 views
How Do You Explicitly Set A New Property On `Window` In TypeScript?
posted Dec 1, 2016 by Jdk

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Using window keyword we can achieve. See below

   declare global {
        interface Window { MyNamespace: any; }
    }

    window.MyNamespace = window.MyNamespace || {};
answer Nov 20, 2018 by Aarati Mahajan
...