简体   繁体   English

将打字稿和javascript文件都集成到角度相同的项目中

[英]Integrate both typescript and javascript files into angular same project

Would it be possible to have both typescript and javascript files in the same angular project? 可以将打字稿和javascript文件都放在同一个角度项目中吗?

I have a pretty big project in angular and I want to migrate it to typescript without renaming all files to .ts and fix the errors. 我在angular中有一个很大的项目,我想将其迁移到打字稿而不将所有文件重命名为.ts并修复错误。 Would it be possible to have only one part of an angular application written in typescript and the other one in javascript? 是否有可能只用打字稿编写一个角度应用程序的一部分,而用javascript写一个?

Yes it is possible with the latest flag --allowjs in typescript 1.8. 是的,可以在打字稿1.8中使用最新的标志--allowjs You can modify your tsconfig.json to include it like this: 您可以修改tsconfig.json使其包含如下内容:

{ 
    "compilerOptions": { 
        "allowJs": true
    }
} 

See roadmap for more info: Typescript 1.8 , and specifically here: link 有关更多信息,请参见路线图: Typescript 1.8 ,特别是此处: 链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM