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?
Join the DZone community and get the full member experience.
Join For Free
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?
Published at DZone with permission of Raymond Camden, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments