I’ve been working with Angular 1.5 for a while. About 2 weeks ago, my team and I decided to look into Angular 2/4 for a new project that we are going to start.
Like many developers out there who already know Angular 1, I want to share some tips for learning Angular 2.
- Don’t we all love videos? Start with a quick 60 min guide on YouTube.
I watched “Angular 2 in 60 Minutes” by Traversy Media to get a quick look of Angular 2 and syntax changes. In this video, he covered Components, Services, Data Binding, Forms, Routing and etc. After watching this video, I made a quick app using Angular CLI that contains a Navigation Bar on top and a simple To-Do list app ( it doesn’t store the to-do list in DB yet).
I wrote this To-Do app to test out how Routing works in Angular 2. And the app lets user delete a To-Do item and add a To-Do item to the list.
2. Read Angular 2 Architecture Document
After you have tried a simple Angular 2 app, I highly recommend you to read the official Architecture Overview document. Here.
Read this architecture overview carefully. It will go a long way to help you understand how each component/service can be used in your app.
3. This is obvious. But the official Angular Tutorial is great!
The hero app is great. It covered a wide range of topics that you will need in a basic app.
4. Finally, the cheat sheet for us Angular 1 people!
After a few days of learning, you probably got the gist of Angular 2. But remembering the different syntax might be tough. Cheat sheet to the rescue! I keep this open very often. https://angular.io/guide/ajs-quick-reference
It basically tells you in the previous version, you use
<button ng-click=”vm.toggleImage()”>
But in Angular 2, you do this instead:
<button (click)=”toggleImage()”>
This quick reference/cheat sheet is so helpful for people who used to program in Angular 1.*
To end, I would like to say I really love Angular 2/4. It’s easy to start and I love the Object Oriented approach and Typescript. Coming from a Java background, I naturally prefer Typescript over JavaScript. Hope you also find Angular 2 easy to learn and easy to use!