What is AngularJS and Why AngularJS

AngularJS is nothing but JavaScript MVC framework for the web. To learn AngularJS, we just need to know HTML and JavaScript that means no need to know learn any new programming language. AngularJS developed based on MVC (Model-View-Controller) pattern. The MVC pattern divides the application into three distinct parts, and those are Model, View, and Controller.

Model: This is the basic part of the application and data behind the application. This data fetched from server and UI that user sees derived from the model.

View: This is the UI that user sees, and it is dynamic, generates based on the model of the application. 

Controller: This is the business logic layer for the application which performs actions such as fetching data from the model and make a decision how to display model on UI. 

AngularJS Advantages: 

  1. AngularJS is the Single Page Application (SPA) meta-framework. If we use a lot of client-side code like JavaScript in the application, it is a very tedious process to maintain the application. But AngularJS will do a lot of things for us and us just we need to focus on our application logic.

  2. By using AngularJS, you just need to focus on the business logic. The code you write with AngularJS will focus mostly on business logic only.

  3. With AngularJS, we need to write less number of lines of code to accomplish the task when compared with JavaScript solution using jQuery.

  4. It is very easy to understand the application just by looking at the HTML and Controllers if we use AngularJS.

  5. Through AngularJS, the application can be styled by using HTML and CSS. We can change the layout and design of the application completely without touching a single line of JavaScript code.

  6. It is very easy to do the unit test the AngularJS application because application separated into different layers.

  7. AngularJS templates are in HTML only, so designers can easily style them.