So, this begs the question, "Why should you choose AngularJS?" The choice of framework depends on a lot of factors—sometimes even personal preferences play a role in deciding a framework. However, let's look at some of the technical and pragmatic reasons that justify choosing AngularJS over other frameworks:
Documentation: Google maintains an excellent and in-depth documentation for AngularJS at https://docs.angularjs.org/api.
Books: There is a wealth of excellent books on AngularJS, such as Mastering Web Application Development with AngularJS (https://www.packtpub.com/web-development/mastering-web-application-development-angularjs), Mastering AngularJS Directives (https://www.packtpub.com/application-development/mastering-angularjs-directives), and many others.
Data binding: With two-way data binding, when you update the DOM, your model gets updated and vice versa. This leads to code reduction.
POJO: Plain old JavaScript objects can be used for data binding. You don't need any special syntax to achieve data binding.
The $http service: This simplifies Ajax communication.
The $resource service: This provides a higher level abstraction than the
$http
service. This service is used to communicate with RESTful APIs.HTTP interceptors: For purposes of global error handling, authentication, or any kind of synchronous or asynchronous preprocessing of request or postprocessing of responses, we can use HTTP interceptors.
Directives: This is a complex but very powerful feature of AngularJS. This feature (https://www.packtpub.com/application-development/mastering-angularjs-directives) is the one that "teaches old HTML, some new tricks". Using directives, you can build custom HTML elements, attributes, and so on.
Dependency injection: Most of the server-side object-oriented languages have dependency-injection support available through some library/framework. You can expect the same ease of use with AngularJS's built-in support for dependency injection in your favorite language—JavaScript.
Unit testing support: This is a must when developing with a dynamic language such as JavaScript. AngularJS has excellent support for unit testing—it comes with mocks for a number of its built-in services.
Support: AngularJS is backed by none other than Google. It becomes easy to convince your boss if a company like Google is behind a framework or technology.
Community: This plays an important role when you are learning something new. There are already a lot of questions answered on sites such as StackOverflow (http://stackoverflow.com/). You'll find many more resources on Twitter and many other websites.
Companion frameworks: Ionic (http://ionicframework.com/) is a frontend framework to develop hybrid mobile apps with HTML5. This framework is optimized for AngularJS.