In this topic we will overview on AngularJS, after getting an overview we will create a ASP.Net MVC application with implementing AngularJS(v1.4.8).
Introduction
I have prepared this article to share/clear concept about AngularJS the way i learnt. I thought to share with audience who are searching for learning to AngularJS in simplyfied way. This article is for them.
Here’s the flow of this article which we will get into step by step. First we will pick with what & why.
- What is AngularJS?
- Why named AngularJS?
- Why another JavaScript framework? JQuery VS Angular.
- We will differentiate them with an example.
- Download & Install AngularJS Library in Visual Studio 2015.
- Start AngularJS with Visual Studio.
- We will submit a Form with AngularJS.
- About Form State
- Send Form data to MVC Controller.
- Make URL (# free) in AngularJS.
Ok let’s get started. Before we focus any topic let’s know what is AngularJS.
What is AngularJS?
AngularJS is a Client side JavaScript MVC-Based framework. It is Open source, Supported & maintained by Google. AngularJS as “Angular” or “Angular.js” was initially released in 2009, which goal to enhance the development process and testing.
Know more about Client side here.
Why named AngularJS?
We know HTML that is contained (eg: ) with angle brackets(<>) thus the name[according to FAQ] came “Angular”. AngularJS uses directives like ng-app,ng-model that prefixed with “ng”(base directive) which bring to mind “Angular”.
Why another JavaScript framework?
Both are purposed to client side scripting, but AngularJS simply offers more features and advantages. As we know that AngularJS is MVC-Based framework which is modular and reusable.
Here’s an overview of both:
AngularJS-
- Google Supported & maintained Open source JavaScript MVC framework.
- Smart Data-binding.
- Use MVC design pattern.
- Form Validations
- Supports routing (Single Page Application).
- Uses Dependency Injection(DI).
- Easy to Unit test
- Modular & reusable architecture
- REST-friendly
JQuery-
- Lightweight Open source JavaScript framework
- Great tool for manipulate and control DOM elements
Example:
AngularJS-
First Name:
Last Name:
Result: {{fname +' '+ lname}}
JQuery-
First Name:
Last Name:
Result: