In my angular component, I have to access a variable defined in window scope. For that, I have defined like below.
if (this.window.nativeWindow.KAMPYLE_ONSITE_SDK) {
console.log(' sureveyDisplayed :- ' + this.window.nativeWindow.KAMPYLE_ONSITE_SDK.isSurveyDisplayed());
console.log(' updatePageView :- ' + this.window.nativeWindow.KAMPYLE_ONSITE_SDK.updatePageView());
}
After adding this, typescript throws compilation error
error TS2339: Property 'KAMPYLE_ONSITE_SDK' does not exist on type 'Window'.
I understand that typescript cannot find this variable defined anywhere but can anyone tell me how to embed a variable defined in window scope into a angular component?
Thanks, Suresh