Start with AngularJS

What is AngularJS:

It’s a JavaScript framework developed and maintained by Google. JavaScript is always a priority over the server side to handle many things on the client side before page load. So using a framework based on JavaScript is always an advantage. As it’s written by Google, expert help will also be there to get you out of trouble anytime. Angular is 100 percent JavaScript and compatible with both windows and mobile browsers.

Again it’s a Google product so it will be well tested on all the browsers like Chrome, IE, and Firefox etc.

Benefits of what we will get from AngularJS:

  1. Two way binding:

    First of all what is two way binding?? Let's say I have a variable X, as soon as I will change the variable of X, the changes should also be reflected on Browser.

  2. I must say it's designed to support MVC.

  3. Very amazing for CRUD operations especially for Web applications.

  4. After understanding it, it’s easy and helps us in writing fewer lines of code.

  5. Safety concerns taken care of by Google.

Let’s start with the Basic application

I hope you are aware of how to add AngularJS from NuGet? If not please read my blog on the same i.e. Adding Angular NuGet Package. You can add the same from google cdn as well by using below tag:

  1. <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script>  
Let c the code part now below:

code

I have tried to create a very basic example using AngularJS.Will move further step by step. I have tried to add two string variables and two integers.

Let’s talk about tag first:

Ng-app:

This tag initializes AngularJS in your application. In my code, it’s not able to recognize the tags so I have used data- prior to that.

Ng-model: It will bind the value of control to data.
Ebook Download
View all
Learn
View all