Anthony Anthamatten

Angular Development

Angular code inside the Visual Studio Code application

Angular is an open-source Single Page framework created by Google engineers Misko Hevery and Adam Abrons in 2010 and robustly supported by Google and the community today.

I have been using the framework for front-end development since version 2.0 and many iterations since. It was one of the more challenging software development platforms I have learned, but once you get the hang of it, it’s robust way to build modern web applications providing excellent scalability and maintainability.

Reasons I like Angular

These are a few of my personal preferences for choosing the Angular framework over others if I am creating an enterprise web application.

TypeScript

TypeScript is a superset of JavaScript, providing a more strongly-typed and consistent way to write code that is easy to understand and maintain.

MVC Architecture

The shortest way to explain this concept is in the name MVC, “Model-View-Controller”. There is a separation of concern. If I am writing something and there is a problem with the U.I., I will take a look at the view and the underlying HTML behind that. If it’s a data problem, look at the controller. It gets deeper than this, but that is the easiest way to explain.

Two-Way Data Binding

In one-way data binding information flows in one direction, and is when the information is displayed, but not updated. In two-way data binding information flows in both directions.

For example, if the UI updates and and I want to do something, say call a web-service behind the scenes, the UI will let me know. Likewise, if data changes or some other elements update, those elements can be notified too.

Other frameworks, such as React are primarily one-way binding. You can do the same thing but it requires additional code, whereas two-way in Angular is built-in.

Dependency Injection

Another cool feature of the Angular framework is dependency injection. I most often use this to inject a service into a controller. Say you wrote a login, logout, who is this user service, or what are their roles? You can easily write it once and inject it into any place you need.

Pipes

The are not the kind Popeye smoked. Pipes are used to transform strings, currency amounts, dates, and other data for display. Pipes are functions to accept an input value and return a transformed value.

Validation

Min, Max, Length, Required, Email… they are great for validating forms in Angular before you submit a form.

Lazy-Loading

This is especially important in mobile development. If you have a lot of data or pictures, whatever it is, you can easily lazy-load the information a chunk at a time.

Modules

It is a great way to organize a project. Say you have everything related to the user, or say it is a bunch of screens related to a student, or a teacher, or an administrator. Modules are a great way to organize and import them once where you need them.

Tree-Shaking

Angular is very smart at organizing the ultimate code that runs your app. Tree shaking is a brilliant concept that figures out the best way to minimize and run it in the smallest package possible.

Smart Builds

Angular is great at figuring out if there is a problem. As a developer, you will often know before you push to source control if there is an issue.

Considerations

There are a few considerations when choosing the Angular framework.

Learning Curve

Angular has a more pronounced learning curve than some other JavaScript frameworks such as React. It has a broad feature set and somewhat complicated design that may seem daunting to those new to the framework.

Codebase

Sometimes Angular apps have a greater amount of boilerplate code which may be more challenging to maintain.

Updates

Angular has a frequent update cycle. While you aren’t required to update the framework for an existing app, it should be noted that some version updates may need code modifications. I spent a day modifying code when I updated an app from version 10 to version 17.

Conclusion

Angular is a terrific framework I enjoy working with for single page web applications. There are other worthy platforms and frameworks you may consider. The landscape in this technology space constantly evolves.

Additional Resources