As long as we have been developing software applications, the oh-so-common phrase is xyz worth learning has been around. Well maybe not so much back in the C/Fortran days, but you get my gist. In 2022, this question is constantly asked as we have so many options when it comes to what to implement in your application. The hot topic for today, is learning Angular in 2022 worth your time? Or could you spend your time better learning another web framework?
What is Angular?
Angular is web development framework that is built on TypeScript, and for those who are not familiar, TypeScript is JavaScript with the addition of types. This is good news for the developers that have existing skills with writing JavaScript, as picking up on the additional Types should be a breeze. For those who do not have at least foundational knowledge of JavaScript, learning TypeScript might prove to be more difficult. Angular is a component based web framework, that is typically beneficial to use when creating large web applications.
Since Angular is a component based web framework, these components in combination with one an other, will help us create a web application. For each component in an Angular project you will have a associated TypeScript class, in which you will be able to implement your component level logic. Aside from your TypeScript class you will have an associated HTML template to tell Angular how to render your component on the page, and if desired an optional CSS style sheet to define the look and feel of your component template.
The Learning Curve
Now I wouldn't go as far as to say that learning Angular takes an excessive amount of time and effort, but compared to other common web frameworks like React, the learning curve with Angular is going to be a little bit steeper. There are some deeper theories to Angular like Dependency Injection, which tend to confuse new comers, but after working with these nuances you'll be glad you chose to work with Angular for your next project. There are countless resources to assist in your journey learning Angular, and in my opinion they have some of the best docs which can be found here. And yes, just to clear up any confusion, these docs are actually useful!
Creating your first app
Taking those first steps with a new technology is always stressful, but with Angular it is extremely easy to get your first app serving on your localhost. If you have node and npm already on your machine, half of the process is already done. If not, you can follow this link to download node, and in most cases npm will be downloaded along with node. Next we will need to download the Angular CLI using the following command:
npm install - g @angular/cli
Once the Angular CLI is downloaded, you will be able to create your first application by executing:
ng new myTestApp
Make sure to choose yes for routing, and to choose either CSS or SCSS for your style sheet. From this point you can open up your project directory and run either:
code .
or
ng serve
The "code ." command will open your current project in Visual Studio Code (my go to editor), and the "ng serve" command will start serving your first Angular application at localhost:4200.
And that's it! Your first project is created and serving all with 3 commands, excluding the command to open up your project in your editor. Pretty simple isn't it?
So is Angular worth learning?
I may be biased when it comes to whether you should learn Angular, or to chose another alternative web framework, but my opinion is yes. Angular is my go to framework for both small and large web applications and the project structure/syntax is easy to work with once you become accustomed to it. By nature Angular is meant for large scale applications which makes scaling projects a breeze, which is always a thought in the back of my mind when starting a new project. With the addition of new packages like Angular Universal to assist with the many downfalls of SPA's not being compatible with modern SEO practices (if you're willing to give up CSR), and Ionic Angular for mobile application development, it's almost a no brainer to me. So if you're interested in creating highly scalable and easily readable modern web applications, I would definitely spend the time to learn Angular in 2022.
Interested in creating a discussion on this blog post? Start a conversation in our Web Development forum!