AngularJS is dying… here are 5 quick reasons why you should upgrade to Angular
With no more active development on AngularJS since 2018 I’m amazed at how many big-name websites I find that still use it.
So… here are 5 solid reasons why you should migrate from AngularJS to Angular.
This makes large applications easier to build by separating all logic into separate pieces. And also easier to debug because unique tests can be written to test a specific component.
The Angular CLI
The Angular CLI is a command-line interface tool that you use to initialize, develop, scaffold, and maintain Angular applications. You can use the tool directly in a command shell, or indirectly through an interactive UI such as Angular Console. — Angular
The Angular CLI simplifies the entire process of generating new apps, services, components and adding new libraries. It is so simple to use that a 4-year old could create an Angular app if they wanted to.
To generate a new app —
ng new hello-world
To serve it with hot-reloading—
ng serve --open
To add a new component —
ng generate component component-name
To add a new service —
ng generate service service-name
To add the Material Design Library —
ng add @angular/material
To minify, package and build it —
ng build --prod
That was… until I started using Angular. It takes Typescript and turns it into a powerful front-end language.
The benefits of Typescript make it much easier to develop, debug and maintain large projects. Especially when there are many developers working on one project.
When you create an Angular application, the CLI downloads and installs everything you need to test it with the Jasmine test framework.
Every time you generate a new component or service, the test files are also generated and ready for when the developer wants to write the tests.
And then to run the tests —
At its simplest, a service worker is a script that runs in the web browser and manages caching for an application. — Angular
Most modern web app should have a service worker to do some basic caching.
But… implementing a service worker that manages a local cache can be difficult at times.
However, in Angular all you need to do is run the CLI command
ng add @angular/pwa --project *your-project-name* and then edit the ngsw-config.json file to specify which files should be cached and other caching options.
Bingo! You are done setting up your service worker.
Something that a developer might spend hours coding, can be done with Angular in 5 minutes.
To sum things up, Angular is an entire framework with all the tools, libraries and best practices baked right into it.
One of my huge frustrations as an AngularJS developer was the variation of coding and design practices I found between projects. The Angular framework is a huge step in providing more consistency and making larger projects easier to manage, debug and deploy.
I hope you found this short article helpful and simple.
Please give it more energy by pounding that 👏 👏 👏 clap button. Thanks!