4 ms·
"Write Angular 2 with style" > Request javascript version "This chapter is not yet available in JavaScript. We recommend reading the TypeScript version." LOL
by gremy0 10y ago
"Write Angular 2 with style"
> Request javascript version
"This chapter is not yet available in JavaScript. We recommend reading the TypeScript version."
LOL
- spriggan3 10y agoSame with their tutorials on angular.io . Angular2 is a framework build for Typescript and Dart, barely for Javascript and certainly not for ES5.
- zip1234 10y agoTypeScript is fantastic. Maybe it will be the undoing of Angular2 but I doubt it. The Angular2 team chose TypeScript because writing large applications using the limitations of ES5 is extremely difficult. TypeScript makes the task manageable and compiles back into ES5 (or whatever you want). The tooling is lightweight and freely available. Give it a try!
- spriggan3 10y agoTypescript isn't Javascript. I gave it a try already,for 2 years, and I used Angular 1 in production, I'm moving to something else like React or Vue.js, both supporting actual Javascript (even JSX isn't necessary). Good luck with your non standard syntax like decorators... Angular 1, despite its internal complexity, was just one file dropped in an html page and you're ready to go. There was nothing that mandated a complete rewrite with breaking APIs at first place. I complained to Igor 3 years ago about it. Well let's see how it goes.
- radicalbyte 10y agoTypescript is ES with totally optional type information, which protects you from a whole lot of bugs and for javascript bad API design (i.e. horrors like APIs which return different types with different input). 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#..
- Touche 10y agoYou're wrong, there are various other differences. Some of what TypeScript implements isn't supported by JavaScript yet (like import/export for example). It's very much a different language, which is fine, but it is annoying to constantly hear "it's just JS with optional types".
- pfooti 10y agoI use import / export in my regular javascript. I just use babel and browserify for it. I am sure that there are typescript language features that aren't "just optional types", but I don't think import / export is so far outside the normal ES/next kind of norm that you'd call it some kind of MSbomination.
- Touche 10y agoBabel is not "regular JavaScript", your import/export statements won't work when browsers and Node support them (you are required to include the .js extension and Babel doesn't enforce that). Babel also supports things like JSX and Flow.
- gshulegaard 10y agoI'm sorry but I will never use Angular 2.0 unless it can be used with straight JavaScript. I am a backend developer that, for personal projects, needs to do small amounts of front-end work. Anything that potentially increases complexity or involves a redundant learning curve (learning yet another _imperative_ language that compiles into JavaScript anyway) is not something I am going to invest time in. 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/ 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.
- plexicle 10y ago"both supporting actual Javascript (even JSX isn't necessary)." 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.
- AshleyGrant 10y ago"non standard syntax like decorators"???? decorators are a TC39 proposal from Yehuda Katz and Jonathan Turner...
- spriggan3 10y agoproposal =/= in the spec. Typescript used to have a module implementation that was not compatible with ES6 modules. Guess what happened for Typescript developers.
- Roboprog 10y agoI loved the way you could start with a static HTML mockup with Angular, then add the boilerplate in a single .js file, then define a simple data model in the js, slap in some curly braces and ng-model attributes hit "reload" and try it out, lather, rinse, repeat -- all without any build (transpile, concat) step. Angular 2 looks like a JEE "inspired" nightmare.
- Roboprog 10y agoOf course, by the time you get to event handlers and REST calls, you need a back end, but you could mock up an awful lot in 1.x without ever worrying about a "build".
- Roboprog 10y agoRemember GWT? We were all going to write client-side widgets in Java. Turned out, that was a nuisance.
- paulddraper 10y agoI'm using it with ES5 only.
- Roboprog 10y agoYou should put up some examples on github and post a link. TIA
- spriggan3 10y agoWhy don't you post some snippets or gists so that everybody can get a mesure of what a large app looks like with Angular 2 ? that's right, it is not designed to be used with ES5.
- paulddraper 10y agoWell, the project is not open source :(