admin 管理员组文章数量: 1086019
Is it possible to use TypeScript instead of JavaScript in a Django project developed using Visual Studio?
At the moment I just tried to add a .ts file and import it to a HTML file. It fails when finding non-Javascript syntax though. I was wondering what I was missing.
Do I have to configuration Visual Studio for it? (TypeScript sdk is already installed).
Is it going to pile the .ts files into JavaScript by itself or do I have to go through extra steps?
Is it possible to use TypeScript instead of JavaScript in a Django project developed using Visual Studio?
At the moment I just tried to add a .ts file and import it to a HTML file. It fails when finding non-Javascript syntax though. I was wondering what I was missing.
Do I have to configuration Visual Studio for it? (TypeScript sdk is already installed).
Is it going to pile the .ts files into JavaScript by itself or do I have to go through extra steps?
1 Answer
Reset to default 7You are going to have to pile your Typescript files in Javascript files.
The best way to do this is to use the tsc
mand available to you when installing typescript with a package manager like NPM.
Make sure you then import your Javascript files in your HTML files. If you're using Django Templates, then use Static Files to link to the appropriate Javascrpt files.
I hope this helps you :)
版权声明:本文标题:javascript - How do I add TypeScript files in a Django project made with Visual Studio 2019 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://roclinux.cn/p/1744081607a2530350.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论