Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Time for Angular 2?

DZone's Guide to

Time for Angular 2?

I’ve been avoiding even thinking about the latest rev of Angular as every time I did look at it, I came away with a headache. It was weird and the docs were even weirder. Are you using Angular 2 yet, or have you been holding off?

· Web Dev Zone
Free Resource

Learn how to build modern digital experience apps with Crafter CMS. Download this eBook now. Brought to you in partnership with Crafter Software

angular I’ve been avoiding even thinking about the latest rev of Angular as every time I did look at it, I came away with a headache. It was weird and the docs were even weirder. I saw plenty of blog posts on the topic, but in general they dealt with one small slice of Angular 2 and were too confusing for me to grok.

Over the holidays, I checked out the web site again (Angular 2 can be found at https://angular.io/ whereas Angular 1 is still at the old site: https://angularjs.org/). I tried the five minute quick start and while it took me a bit more than five minutes, it made a bit of sense. It certainly wasn’t crystal clear to me, but it wasn’t crazy either.

I then went through the tutorials and things began to make even more sense. I’m far from being even close to being able to build a demo with it, but the basics are beginning to click for me.

There were three things in particular I ran into that caused me grief.

1) Working with Angular 2 means working with TypeScript. I like TypeScript. But, I’m kind of disappointed that working with Angular now means working with a build system to get it into the browser. To be absolutely clear, I’m not saying this is bad. I’m just saying I feel a bit disappointed that this is required now. I’ll get over it.

2) The @Component stuff was terribly confusing to me until it finally sank in that those blocks are providing metadata to the classes. It seems so obvious now, but I just couldn’t understand what in the heck stuff like this was doing:

import {Component} from 'angular2/core';

@Component({
    selector: 'my-app',
    template: 'My First Angular 2 App'
})
export class AppComponent { }

3) One thing I really didn’t like in Angular 2 was all the different types of “syntax sugar” being used in templates. Here are just a few examples: [(ngModel)]="foo.name" and *ngFor and (click)="something". I figured there was no way in heck I’d be able to get that right. Luckily, there’s a great cheat sheet that nicely documents all this and is easy to use.

So, what’s next? I plan on making my way slowly through the rest of the docs. I’m also going to reread the tutorials a few times. I then need to make the time to look at Ionic 2.

For a while now I’ve been telling people that (at least in my opinion) it was too early to start playing with Angular 2. Now, I definitely feel like it would be a great time to start playing with it and possibly even building real apps with it. I’d love to know what my readers think, so leave a comment below. Are you using Angular 2 yet, or have you been holding off?

Crafter is a modern CMS platform for building modern websites and content-rich digital experiences. Download this eBook now. Brought to you in partnership with Crafter Software.

Topics:
angularjs ,web dev

Published at DZone with permission of Raymond Camden, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}