admin管理员组文章数量:1300225
I am curious when it would be appropriate or prudent to use Typescript in an AngularJS application? I have seen tutorials where TS is used in a Node, Express, Mongo back-end. However, I am curious how TS holds up when Angular is added into consideration.
I am curious when it would be appropriate or prudent to use Typescript in an AngularJS application? I have seen tutorials where TS is used in a Node, Express, Mongo back-end. However, I am curious how TS holds up when Angular is added into consideration.
Share Improve this question asked Jul 5, 2016 at 14:09 MadPhysicistMadPhysicist 5,84113 gold badges49 silver badges121 bronze badges 3- 5 TS "piles" to JavaScript. So you can pretty much use TS anywhere you can use JS. As a matter of fact, you could even mix, and have an app written in both TS and JS, and even write JS in TS files! – Jite Commented Jul 5, 2016 at 14:10
- Yup we use Typescript with AngularJS and its no problem – Revive Commented Jul 5, 2016 at 14:12
- Hey, just a side note: in the typescript website there actually is a snippet in the bottom of the page where angular developers references to typescript itself for being useful to them: prntscr./bp3foi – briosheje Commented Jul 5, 2016 at 14:19
5 Answers
Reset to default 3Yes, it is definitely all right to use. I work on a project with angular 1.4 and Typescript. It was done that way keeping in mind future migration to Angular 2.
Yes you can. You will have to install the typings for Angular. You can do this with the TypeScript Definition Manager. Basically what this does is tell typescript how Angular is (strict) typed.
Using NPM:
npm install -g tsd
tsd install angular
TypeScript can be used with Angular or any similar framework. All you need is definitely typed version of framework. AngularJS typings and code samples can be found here
Typescript is a transpiler that piles it's code into JavaScript.
Since angularjs is a JavaScript framework, it works naturally.
There are definitely typed files that were made for angular as you can see here.
P.s. Angular2 was built on Typescript.
Angular 2 is available with TypeScript
. Have a look here for Angular 2 Quickstart in Typescript https://angular.io/guide/quickstart
本文标签: javascriptIs It Possible to Use Typescript in an AngularJS ApplicationStack Overflow
版权声明:本文标题:javascript - Is It Possible to Use Typescript in an AngularJS Application? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741658072a2390875.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论