A comprehensive list of Pros and Cons of using AngularJS

While AngularJS has become very popular and is considered to be the best framework available in building single page web applications, it comes with it’s own set of problems. Lets try to understand the advantages, disadvantages, and limitations of using AngularJS.

Pros

Two-Way Data Binding

Data binding in AngularJS is synchronization between the model and the view. When data in the model changes, the view reflects the change, and when data in the view changes, the model is updated as well. This happens immediately and automatically, which makes sure that the model and the view are updated at all times.

Quick Prototyping

Unlike other popular JavaScript frameworks, Angular conveniently relieves the developer of actively manipulating DOM (Document Object Model), all thanks to its two-way data binding approach. It means that the developer saves time and efforts to code, translate and update the DOM elements. This enables the developer to quickly prototype and deliver dynamic single page web applications.

HTML templates

AngularJS provides the capability to use plain HTML templates. The templates are passed to the compiler as DOM elements and not as strings and this ensures better workflow. AngularJS also allows for easy manipulation, extension and re-usability of these templates.

Improved Server Performance

Because AngularJS supports caching and many other processes, it reduces the burden from server CPUs. It means that the server performs extremely well thanks to reduced traffic (because it only serves static files and responds to the API calls).

Easy Testability

One of the underlying aspects of Angular is that it builds highly testable websites and applications. By allowing unit testing and end-to-end testing, it makes testing and debugging much simpler. Dependency injections, for example, allows various components to be isolated and mocked. Protractor, Jasmine and Karma are other unique testing tools that the framework offers.

MVVM Architecture

AngularJS implements Model-View–Controller and Model-View-View-Model architectural patterns which lay strong foundations for application performance. With these divisions, the data is separated from design and visual representation which makes even complex web applications easy to manage.

Directives

AngularJS makes use of directives that keep the scripts and HTML pages clutter-free and extremely organized. Directives allows us to create independent codes by cramming together specific functions and using them repeatedly. Apart from a set of pre-defined directives, the framework also allows developers to create custom directives. Using directives enables the developer to extend HTML.

Dependency Injection

Dependency Injection helps in structuring your applications. It enables you to organize code into coherent components and then combine them in a loosely coupled way. Dependency injection allows various components to be isolated and mocked thus enabling better testability.

Cons

JavaScript Support

What if your application is accessed from computers where JavaScript is disabled? You are in complete soup right? They won’t be able to access your app. If there are many such users, you can expect your AngularJS-based web properties to be less useful.

Difficulty Learning

One common thing that we hear from developers who start using AngularJS is that it’s difficult to learn while proficient AngularJS developers consider it as a minor hiccup. Rather than following a straight learning graph, newbies may have to face difficulty in getting adapted to the framework.

Page Load Times

While DOM manipulation is considered to be one of the greatest advantages of AngularJS, it also poses to be a major disadvantage too. Because AngularJS  has to perform additional tasks like DOM manipulation, it may be rather slow at times. But, this limitation is not true for all the devices and many modern browsers and devices handle this very elegantly.

Scopes

Scope is one of the awesome features of AngularJS. It is a special javascript object which plays the role of joining controller with the views. But, debugging scopes can be very difficult. Layered and hierarchically arranged scopes can be very complex to handle.

Run-time Config

Since AngularJS applications are loaded upfront, it lacks configuration abilities after the application bootstraps.

Routing

There are many known limitations with ngRoute. The initial Angular router was designed to handle  a few simple cases. As Angular grew, we’ve slowly added more features. However, the underlying design is ill-suited to be extended much further. It’s very easy for developers to write apps that ignore URLs and break the back button with Angular. Angular should make it easier for developers to create apps with deep linking.

Search Engine Indexability

Google, Yahoo, Bing, and other search engines crawl the web in traditional ways using traditional crawlers. They run robots that crawl the HTML on web pages, collecting information along the way. Luckily, crawlers of the larger sites have started to implement a mechanism that allows us to make our JavaScript sites crawlable. Apps developed using AngularJS need further tuning so they can be indexed by Search Engines. 

Documentation

The official documentation that is available for AngularJS is definitely not up to the mark. Developers have to depend on articles available on the web to completely understand certain key concepts. 

All said and done, the framework is definitely worth trying. You may want to check out the website MadeWithAngular to see a list of top websites that are built on AngularJS Framework.

 

AngularJS Pros, Cons, Advantages, Disadvantages

Most of these pros and cons mentioned in this article are for AngularJS 1.x. Will keep the post updated as and when I get a change to try AngularJS 2.0

Top