Goland IDE对.html文件的TypeScript支持

huangapple go评论70阅读模式
英文:

Goland IDE Typescript Support on .html files

问题

我正在使用Jetbrains的Goland IDE编写Go代码。

如何在我的.html模板文件中使用TypeScript?这些文件中混合了HTML、CSS和JS。

谢谢!

英文:

I'm coding in Go using the Goland IDE by Jetbrains.

How can I use typescript inside my .html template files? These files have HTML and CSS in them mixed with the JS.

Thanks!

答案1

得分: 1

TypeScript是JavaScript的超集,需要在浏览器中运行代码之前进行编译。

您可以按照“将TypeScript编译为JavaScript”中描述的步骤,在GoLand中编译您的TypeScript代码。

然后,您可以通过<script>标签在HTML模板中引用生成的JS文件。

英文:

TypeScript is a superset of JavaScript and requires compilation before you can run your code in a browser.

You can compile your TypeScript code using GoLand by following the steps described in "Compiling TypeScript into JavaScript".

You can then reference generated JS file in your HTML template via the &lt;script&gt; tag.

huangapple
  • 本文由 发表于 2023年4月11日 08:58:56
  • 转载请务必保留本文链接:https://go.coder-hub.com/75981720.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定