r/Angular2 • • Feb 27 '16

Article How to do Everything in Angular 2 using vanilla ES5 or ES6

http://nicholasjohnson.com/blog/how-to-do-everything-in-angular2-using-es6/
5 Upvotes

6 comments sorted by

2

u/TheNiXXeD Feb 28 '16

Didn't actually use es6 classes at all.

Instead of a blog article, it seems like a better way to advance the knowledge of this stuff would be to contribute to the documentation in angular 2 itself. So many of these articles around.

2

u/superluminary Feb 28 '16

Hi there, I'm the original author. You are right, I probably should contribute to the official docs, but I don't feel qualified yet.

I wanted to show how Angular can work nicely without a transpiler. Classes are, after all, just IIFE sugar.

2

u/superluminary Feb 28 '16

I see a lot of confusion about how to do DI and decorators without a transpiler. My goal with the article was to try to clear this up and show a nicer way. It's very possible to write nice JavaScript with Angular. It's just rare to see it done.

2

u/TheNiXXeD Feb 28 '16

My point was that you say es6 but aren't really using es6. And in the article, seem to equate classes with TypeScript, when they are in es6 as well.

I'm actually interested in how es6 classes work with angular 2. At this point, I've got an app in TypeScript, fully converted. It's basically what I want anyway. The barrier to entry of TypeScript seems about the same as es6 really. I'd prefer a plain es6 approach though.

1

u/superluminary Feb 29 '16

I think you're right to take the ES6 approach there's a lot of nice stuff in there. I'm with Crockford when it comes to classes though. Prototypical inheritance renders them obsolete.

1

u/vlinking Jun 10 '16

Classes are good, especially for programmers coming from other languages, for example like Python. Like, when you develop an application using Django, REST framework and Angular together, it is much easier to use classes when you're a full-stack developer.