Sum of two number using Angular JS

This article explain you to add two numbers using AngularJS framework
AngularJS lets you extend HTML with new attributes called Directives.

AngularJS Directives
AngularJS directives are extended HTML attributes with the prefix ng-.

The ng-app directive initializes an AngularJS application.

The ng-model directive binds the value of HTML controls (input, select, textarea) to application data.

To implement this we need to write the code like as shown below


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AngularJSFirstDemo.aspx.cs" 
Inherits="AngularJSFirstDemo" %>

<!DOCTYPE html>

<html xmlns="">
<head runat="server">
    <script src="">
    <form id="form1" runat="server">
            <h3>Sum of two Numbers using AngularJS</h3>

            <div ng-app="" >


                <table style="width:100%">
                        <td>First Number</td>
                            <input type="number" ng-model="firstNumber"/></td>
                        <td>Second Number</td>
                            <input  type="number" ng-model="secondNumber"/></td>




Demo :

Blogger Tips and TricksLatest Tips And TricksBlogger Tricks