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.
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.
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).
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.
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.
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 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.
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.
Since AngularJS applications are loaded upfront, it lacks configuration abilities after the application bootstraps.
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
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.
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