Is it still worth using AngularJS in 2020?

Wébert Charles
Frontend Weekly
Published in
3 min readNov 3, 2019
Source : Pixabay

French version here

When you decide to create a web application today you should absolutely choose specific tools and technologies among a large variety of available solutions. From languages and framework to task runners.

When it comes to think about the client-side of your web application, you have to choose maybe one of the most popular frameworks such as React, VueJS and Angular. There is a lively debate on these frameworks in the developer community. Let’s suppose you have chosen Angular. You have to deal with Angular’s versions or simply with Angular and AngularJs.

If you don’t have enough time to dive into TypeScript, you can build your app with AngularJs. Here are some precautions to take and important things you should know:

1. On July 1st 2018, the team entered a Long Term Support period for AngularJS

That means the team are focused on fixing security and compatibility (browsers or dependencies) issues. The latest version (Angular 1.7.x) will not have additional functionalities until 2021 or never.

2. Use a 1.7.x version

Avoid version 1.2.x (legacy). Go for the latest one.

3. Prefer npm version to cdn

It is important to limit external call from your application. Using npm version of AngularJs and it’s dependencies will allow you to access your application offline or in a development environment.

4. Use Yeoman AngularJs generator

It is easy to set up an AngularJs environment, there are several tutorials and guides online. But I recommend you using Yeoman. It helps you setting up a solid environment in just a few line of code in the Terminal. Here is a link that explains the whole process: https://www.airpair.com/js/using-angularjs-yeoman.

5. Choose a Task Runner

A Task Runner will help you concatenate and create minified (uglified) JavaScript, CSS and HTML files. It will also help you add interesting functionalities like Live Reload and build easily your app. AngularJs Yeoman generator gives you the opportunity to choose from the two must important Task Runners : Gulp or Grunt.

6. Structure your app to facilitate its evolution

Maybe some day, for some reasons, you will switch to Angular. Even if your actual code will not work with Angular, you should early think about evolution and prepare it by factoring your code. You can write services logic that could be reused later when you will move to Angular.

7. Create Directives for repetitive blocks

Don’t Repeat Yourself (DRY). When you write code, you must avoid repeating html blocks. Often, a block of code is used must than two time in a project. Dont hesitate to factoring your code. You can even pass parameters to customize the result.

8. Those websites use AngularJs and still work

  1. Google Summer of Code : https://summerofcode.withgoogle.com/
  2. Think with Google Market Finder : https://summerofcode.withgoogle.com/
  3. Google Domains : https://domains.google/
  4. Adobe Font : https://fonts.adobe.com/
  5. Github Community Forum : https://github.community/
  6. Toma Fact Checker : https://toma.ht

Next time, I will show you how to write AngularJs app with modern Angular principles.

--

--