问题
Is it necessary to learn TypeScript first before attempting to learn AngularJS 2?
回答1:
It's not necessary to learn TypeScript but I would definitely recommend that you do learn it. TypeScript is excellent. Not only that, but TypeScript is actually great and very solid
Check this answer
回答2:
The official stance of the AngularJS team is that it will be completely optional. You could write your whole application in the JavaScript we know today (ECMAscript5). But to be honest, there are some serious issues with that version.
- no real classes and inheritance (only prototype)
- no type checking
- no module system (loading parts of javascript)
If you still want to write it in ECMAscript, you'll have to write more code to do the same, and ergo have a higher chance at bugs getting into your code.
You could write it in ECMAscript 6, which is the next version. Unfortunately it's not supported yet in most browsers. But you can already use it, and then compile your code to ECMAscript 5 during the deploy fase (you can setup GRUNT to do this)
Finally you could use Typescript. It offers everything ECMAscript offers and more. Learning it should not feel like learning a new language, since JavaScript is also valid in Typescript. They just added some syntactical sugar to make it more powerful and useful. You will still have to compile it to ECMAscript 5 during deploy.
Via - Bert Verhelst | Quora Discussions
来源:https://stackoverflow.com/questions/33329559/is-it-necessary-to-learn-typescript-first-before-going-to-explore-angular2