Reputation: 6720
I am considering to add TypeScript to my new Angular 1.x projects. I am wondering if it might make any problems for me? (e.g. while TypeScript files will be compiled to JS will it not break any "angular things"?) Or it will work correctly? Does anybody has any experience with that tandem?
Upvotes: 0
Views: 59
Reputation: 193
Typescript and Angular works like a charm. That's because valid JavaScript is valid TypeScript. Try it yourselfe and rename a js file to ts. After compiling, everything should still be the same. Then you can start using Type Definitions to get full intellisense. You can install d.ts files with tsd. After that try to upgrade your code to use namespaces, classes, interfaces, ect. Check out John Papas sample project.
Upvotes: 1
Reputation: 1038920
Since TypeScript compiles to javascript in theory it shouldn't break anything. You can can only get benefits from using TypeScript: Thanks to the Angular tsd
you will get IntelliSense. The only thing that you should be careful with is the target EcmaScript standard. If you need to target some old legacy browsers, the generated output might not work as expected. So you will need to specify the proper ECMAScript version to the TypeScript compiler.
Upvotes: 2