can I get one? this is what I have, but I'm getting a red squiggly line:
let button = <HTMLElement>document.body.querySelector(".btn");
button.addEventListener("click", () =>{});//not sure what to do here. I know its wrong though.
below is my tsonconfig
{
"compileOnSave": true,
"compilerOptions": {
"noImplicitAny": true,
"removeComments": true,
"sourceMap": false,
"target": "es5",
"lib": [
"es6",
"dom"
]
},
"include": [ "**/*" ]
}
With your given tsconfig.json it compiles fine:
let button = <HTMLElement>document.body.querySelector(".btn");
button.addEventListener("click", () => { });
Your IDE is lying. Works fine in VSCode / alm 🌹
The issue was ReSharper. I disabled the plugin and it worked fine. For reference I have attached two picutres, the first with ReSharper enabled, and the second with it disabled.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With