How to use javascript in typescript

前端 未结 2 1184
被撕碎了的回忆
被撕碎了的回忆 2020-12-09 09:17

I have a javascript file called ui.js.

Inside ui.js is UI setup code.

if (!(\"ontouchstart\" in document.documentElement)) {
    document.documentEle         


        
2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-09 10:00

    But I have not been able to figure out how to do that.

    Simply set allowJs to true in your tsconfig.json compilerOptions and then make sure the .js file is included using files/include/exclude etc.

    More

    I did a video on the subject as well https://www.youtube.com/watch?v=gmKXXI_ck7w

提交回复
热议问题