Angular 2 First Impressions

I’m very lucky that my new job uses Angular 2. I thought it would be useful to write up my Angular 2 First Impressions after following the Tour Of Heroes Tutorial.

Full Disclosure – I’ve been using React.js for the last year. At the moment, although I like Angular 2, I prefer some of the decision in React.js. But, I’m trying to keep an open mind. After all, this might be a classic Volcano vs Dante’s Peak or Deep Impact vs Armageddon scenario. You prefer the one you saw first!

Positives

TypeScript

The static type checking and intellisense you get from TypeScript is great. I’ve been struggling with flow on Windows on and off for a couple of months. So much so that I’ve given up. TypeScript “just works”. Big plus.

Minor Points

Naming Conventions

There are a lot of different types of object. The tutorial does a good job of introducing and explaining them. But the naming convention is “strange”. For example, we end up with:

Filename exported name
hero.service.ts HeroService
hero-detail.component.ts HeroDetailComponent
mock-heros.ts HEROES

I’m sure there’s a reason, but I missed it during the tutorial. Like I say, minor point.

Where to put code

This is more related to the tutorial than Angular 2. Several times in the tutorial I didn’t know where to put the code it was telling me to. I resorted to trying in the @Component and if that didn’t work, trying the class.

Might my ability to read and comprehend, but it could’ve been clearer.

Missing Content

The quickstart repo was missing a ` tag in index.html. The routing didn’t work until I added that. That looks like it’s been fixed though

Negatives

Error Messages

The Services part of the tutorial warns “Don’t forget the parentheses! Neglecting them leads to an error that’s difficult to diagnose.” Wow, are they not kidding!

The error messages are mind blowing! For example:

Angular 2 Error Messages

Angular 2 Error Messages

And that’s a good one. Most of the errors I saw were (at my current skill level) impossible to even find something to google for. And that’s if you get an error message. There are way too many silent failures for my liking.

Conclusion

In conclusion, I like Angular 2. The fact that it’s a complete framework seems to mean there are a lot less decisions to make. Need a router, use ‘@angular/router’. Need HTTP Services, use ‘@angular/http’. And the list goes on. That can’t be said for React.js.

I’m looking forward to learning more and can’t wait to see what I can build.

If I’ve missed the point on something, or you can help with some suggested reading. Please leave a comment below.

Leave a Reply

Your email address will not be published. Required fields are marked *