ts-browser icon indicating copy to clipboard operation
ts-browser copied to clipboard

Accessing functions and variables from HTML

Open kanatkubash opened this issue 2 years ago • 1 comments

It seems all typescript code are wrapped in a function and called and this leads to function declarations not to be globally available. How can I declare functions in typescript file globally? For example :

index.ts function handleClick(){ } index.html <div onclick="handleClick()"></div>

Here handleClick is not found, because it is wrapped in an outer function before calling

kanatkubash avatar Nov 17 '21 00:11 kanatkubash