In this blog post, I wanted to discuss my first impressions of Angular 2. I want to discuss why I decided to take a look at Angular 2, some of the issues that I faced when trying to learn the framework, my overall opinion of Angular 2 and finally, provide links to some resources that I found useful. If you would like an in depth tutorial on Angular 2, you can visit the official website here.
Last year I started to become interested in Angular 2 because one of my clients was interested in creating a new Self-Service Portal and Angular 2 was being viewed as an option. As I started to learn about Angular 2, I wrote a few blogs about my experiences, which you can find here.
The Learning Curve!
Have you noticed that despite all the things I had to become familiar with, I still haven’t mentioned the actual Angular 2 Framework? The learning curve for Angular 2 is high mainly because of its ecosystem. Angular 2’s ecosystem presents a significant barrier to entry to learning the new version of the framework but once you become familiar with the ecosystem, you can finally start to learn the actual framework.
After reading countless blogs and articles, I finally found out that it doesn’t matter what version of TypeScript you have installed globally via the Node Package Manager or that you have instructed Visual Studio to evaluate certain paths first to determine which 3rd party tools to use, like the image , Visual Studio is still going to use the TypeScript version in the path below:
C:\Program Files (86)\Microsoft SDKs\TypeScript
Once I understood this fact and upgraded my version of TypeScript that Visual Studio uses via the official TypeScript for Visual Studio install, I was finally able to compile the Visual Studio Quickstart Guide.
I won’t go into the ins and outs of TypeScript but it does represent yet another hurdle to learn Angular 2. You can learn more about TypeScript here.
As I alluded to earlier, there is a lot of boilerplate code you have to setup to get started with Angular 2. In fact, I believe the Angular 2 Team started to realize this, so they created a tool called angular-cli to help. As of this blog post, angular-cli is still in beta and as I have stated, this is yet another tool that a developer may have to learn to get started with the Angular 2 framework. Also, it is my understanding that angular-cli was recently modified to replace SystemJS with Webpack as the default Module Loader.
Once you get past learning the new ecosystem, base concepts, setting up Visual Studio and TypeScript, then you can focus on the actual framework itself. As someone who has developed in Angular 1, I can safely state that just because you know Angular 1 or AngularJS, this doesn’t mean that you know Angular 2. I had to learn how properly configure TypeScript via the tsconfig.json, how to setup dependencies via the package.json, how to bootstrap the Angular 2 application, Angular 2 naming conventions, “everything is a component” paradigm and the new Angular 2 Syntax.
As I worked through the Visual Studio Quickstart guide and eventually, the Tour of Heroes guide, I felt that very few of my Angular 1 skills were transferable and that I was literally learning an entirely new framework. In fact, Angular 2 is so different from its predecessor, that many times I jokingly thought to myself that the Angular 2 Team may have been better off calling Angular 2 something completely different.
After I completed the Tour of Heroes Guide, I ended up writing a blog on how to host it in Azure which you can find here. Also, the Tour of Heroes Guide uses a mock REST service and I wrote another blog post where I outline creating a Web API REST service, hosting it in Azure and modifying the Tour of Heroes application to use it, which you can find here.
As for the project for my client where I thought about using Angular 2, we ended up just re-skinning the existing website. I know that my former client recently wrote a new application in Angular 2 but I don’t know how complicated the application is and what problems their development team faced.
As of now, I would be very hesitant to put an Angular 2 application into production. I feel that the ecosystem and tools are still not mature enough and there aren’t a lot of tutorials and samples available to guide you. However, I am sure someone that is more adept at front-end development could make the case that Angular 2 is production ready. Ultimately, I think whether or not to implement a new project in Angular 2 depends on what type of project you have, the skill set of your development team and how much time you have to learn the new framework.
Below are some the resources I found helpful when I started trying to learn Angular 2.