Welcome back guys, this week I am going to be discussing my experience going from AngularJS 1 to AngularJS 2. When I first started with AngularJS I was debating if I should just skip Angular 1 and go directly to Angular 2, after reading about it online it seemed like I was not the only person asking this question. The general advice at that time was that Angular 2 was too buggy and the documentation was horrible.
I went with Angular 1 and it was great, I ended up creating 3 or 4 projects in Angular 1 one of them I documented here. I liked Angular 1 it wasn’t too complicated and it was easy to implement into any project when you compare that to angular 2, that is a different beast. What do I mean by that?
Angular 2 needs so many files to get started that they even created a tool to help you generate all the files and folders, called angular-cli. Don’t get me wrong the CLI tool is awesome it takes a lot of the heavy lifting and hides it under simple commands. This can be a very bad thing if your brand new to the language because you have no idea what is going on but I will link some learning resources later to show exactly what it does and how to use it.
Hmmm, a lot…I am not going to discuss the details of what exactly is different as honestly I am still learning myself and don’t want to give wrong answers. There are plenty of posts out there explaining the exact different so just google it. The biggest difference is that Angular 2 now uses typescript, so what is typescript:
Which do you learn? Angular 1? Angular 2? Both?
This part might be a bit controversial but it’s not as simple as me just saying one or the other. I think it depends on your situation, what do I mean by that?
Reasons to learn Angular 1 – If you need a job quickly in web development learn Angular 1, create two or three projects and apply. The majority of the jobs *at the time of this post* are in Angular 1 so that is what companies are looking for, a lot of “coding boot camps” will teach Angular 1 as the people that attend these boot camps are trying to get a job ASAP.
Reasons to just learn Angular 2 – If you think you are going to change job in next few years and want to pad your portfolio then I would say go directly to Angular 2. Angular 2 is the future of Angular, angular 1 is not being worked on anymore it seems, they are completely focusing on Angular 2 and making it better.
Reasons to learn both – Only reason I would learn both *if you don’t fit the above* is if you’re interested in the differences and you think the knowledge of Angular 1 will help in the future. I fall into this category, I was interested in the whole Angular ecosystem and I found a lot of information out there on Angular 1 compared to 2, so it was an easier decision back when Angular 2 was younger. If I was starting now I would just start with Angular 2, Angular 1 did help me understanding some concepts in Angular 2 but they are just so different.
Whatever you decide to do here are some resources to learn Angular:
Angular 1: This video playlist by Derek Banas is all you need. Derek does awesome tutorials and after you watch this playlist you can create your first Angular application.
Angular 2: Angular 2 in 60 minutes by Traversy Media is awesome. In this tutorial, he uses a generator to help generate the entire starting project (which I advised against at the start) but that is not the point of the video, it is to explain Angular 2 not the best way to create a project.
Angular 2 with the Mean Stack: MEAN Stack Front to Back by Traversy Media, This playlist is awesome if you’re interested in the MEAN stack and how Angular 2 works with it. He also shows you how to use the angular-cli to generate the files you need which will save you so much time. I recommend this video after you have watched his Angular 2 in 60 minutes video.
That is pretty much all you need, I know Derek plans on creating a video for Angular 2, so when he creates that I will link it. After watching the above you will be in a great position to start creating your own projects in Angular.
I love the concept of Angular, how it works and how easy it is to create dynamic web applications. As you have seen from my previous tutorials I like the MEAN stack and using Angular 2 with the other technologies in the MEAN stack allows you to create extremely powerful and scalable applications. I really hope you enjoyed my ramblings on Angular, I hope this helped somebody and if you have any questions let me know!
Until next time,