Tuesday, April 28, 2020

AngularJS Class 1

What is AngularJS

Angular JS is an open source JavaScript framework that is used to build web applications. It can be freely used, changed and shared by anyone.
Angular Js is developed by Google.
It is an excellent framework for building single phase applications and line of business applications.
This framework is used for developing mostly Single Page applications.
It can be added to an HTML page with a <script> tag.

AngularJS Features

  1. Dependency Injection
  2. Data Model Binding
  3. Model View Controller
  4. Writing less code
  5. Testing
Note:- Unit Testing ready – The designers at Google not only developed Angular but also developed a testing framework called "Karma" which helps in designing unit tests for AngularJS applications.


AngularJS Architecture

MVC stands for Model View Controller. It is a software design pattern for developing web applications. It is very popular because it isolates the application logic from the user interface layer and supports separation of concerns.


  • The Controller represents the layer that has the business logic. User events trigger the functions which are stored inside your controller. The user events are part of the controller.
  • Views are used to represent the presentation layer which is provided to the end users
  • Models are used to represent your data. The data in your model can be as simple as just having primitive declarations. For example, if you are maintaining a student application, your data model could just have a student id and a name. Or it can also be complex by having a structured data model. If you are maintaining a car ownership application, you can have structures to define the vehicle itself in terms of its engine capacity, seating capacity, etc.
  • Routing – Angular can take care of routing which means moving from one view to another. This is the key fundamental of single page applications; wherein you can move to different functionalities in your web application based on user interaction but still stay on the same page.
  • Two-way binding – Angular.js keeps the data and presentation layer in sync. Now you don't need to write additional JavaScript code to keep the data in your HTML code and your data later in sync. Angular.js will automatically do this for you. You just need to specify which control is bound to which part of your model.

4 comments: