Angular2 is a framework build for Typescript and Dart, barely for Javascript and certainly not for ES5.
Angular2 is a framework build for Typescript and Dart, barely for Javascript and certainly not for ES5.
I can understand that it feels strange, especially to someone who has had little exposure to languages outside of Javascript. However it is very much worth investing the time in learning it.
15 years ago I was making the same argument to Visual Basic developers about C#..
It's a shame too, I was a pretty big Angular fan. I used Angular, Ember, and even React and for several reasons I ended up settling on Angular as my favorite SPA framework (back in 2014 and 2015). Back when they announced Angular 2.0 would be TypeScript based, I felt like it was a mistake and that feeling has only gotten stronger as TypeScript has continued to fall behind EMCAScript (http://kangax.github.io/compat-table/es6/).
If TypeScript adopts compilation down to WebAssembly, that would be a reason to learn it/give Angular 2.0 a chance for me, but until then I will stick to Angular 1.0 or move towards React for my next project...which is a shame because I really don't like Reacts focus on the V of MVC. Maybe I will go back and check on Ember, but I wasn't a fan of it's tight binding of Models to Views (sometimes I just need a VC or a V and not a full MVC)...but maybe it has changed.
It can. Typescript is just optional information added to your Javascript. All Javascript is 100% compatible TypeScript. You can use TS extensions anywhere you like, your whole codebase, only certain function APIs, or nowhere at all.
My first job in the mid 80s was in a language with runtime typing. My experience is that "strong" (compile/parse time) typing is not the panacea that many say it is. I've seen far more damage caused by C style "operator precedence stew" issues (vs Lisp style all funcs w/ parens). It's like the Type Police have to punish us for the dark era of C/++ Play-dough Pumper byte molding the industry had to put itself through in the 90s.
In fact, I would much rather see a language that forced modules/data/functions to be flagged which were not immutable/idempotent (which should be an enforced default), rather than an even-trade-at-best static type feature. Yes, that means your "main" would be flagged as "dirty", so it could do I/O, but your library modules (lang; 3rd party; app) would mostly be pure functions.
Anyway, I much prefer dynamic (runtime) types and FP with an occasional dash of OOP style Javascript to the "Let's be like Java!" cult. As Douglas Crockford likes to say "Those people will go to their graves, never knowing how miserable they are". Ironic, considering how the coming holy grail of ADTs/Objects was beaten into us in Uni in the 80s, and FP all but ignored.
Oh, come on now. If JSX isn't necessary, then neither is TypeScript. Have you tried writing React components without JSX? Angular2 in ES5 is saner.
I get that neither is ideal, but let's be real here.
decorators are a TC39 proposal from Yehuda Katz and Jonathan Turner...
Angular 2 looks like a JEE "inspired" nightmare.
Turned out, that was a nuisance.
TIA