0
Answer

How to log a message on call event in typescript only.

Photo of Pinku

Pinku

15h
48
1

I have two file now one is html and one is ts file. upon build js file is creating . but its not working in web browser.
Index.html file..
<button id="increment">Increment</button>

Counter.ts file...This below code is not working..

var inc=document.getElementById('increment') as HTMLButtonElement

inc.addEventListener("click",test)

function test():void{

    console.log("Hello")

}

 

Even the test function showing duplicate function  implementation