Prgm1:
<!DOCTYPE html>
<html>
<title>
Full Name Program
</title>
<head>
<script type=”text/javascript”
Src=[Link]
</script>
<script>
Var app=[Link](“myApp”,[]);
[Link](“myCntrl”,function($scope){
$[Link]=””
$[Link]=””
});
</script>
</head>
<body ng-app=”myApp”>
<h2>Displaying Full Name</h2>
<div ng-controller=”myCntrl”>
Enter First Name: <input type=”text” ng-model=”firstName”><br/>
Enter Last Name: <input type=”text” ng-model=”lastName”><br/>
Your Full Name: {{firstName +” “+ lastName}}
</div>
</body>
</html>
Prgm2
<!DOCTYPE html>
<html>
<title>
Shopping Items Application
</title>
<head>
<script type="text/javascript"
src="[Link]
[Link]">
</script>
<script>
var app=[Link]("myApp",[]);
[Link]("myCntrl",function($scope){
$[Link]=['Apple','Mango','Banana','Grapes']
$[Link]=function(){
if($[Link] &&
$[Link]($[Link])==-1)
{
$[Link]($[Link])
$[Link]=""
}
else
{
if($[Link])
alert("This item is already there in the shopping list")
else
alert("Please enter an item to add")
}
}
$[Link]=function(){
//[Link]("function called")
if($[Link]($[Link])==-1)
{
alert("Please select an item to remove")
}
else{
var index=$[Link]($[Link])
$[Link](index,1)
$[Link]=""
}
}
});
</script>
</head>
<body ng-app="myApp">
<div ng-controller="myCntrl">
<h2>Shopping Application</h2>
<h4>List of Shopping Items</h4>
<table border="1">
<tr>
<th>SLNO</th>
<th>Item</th>
</tr>
<tr ng-repeat="items in shoppingItems">
<td>{{$index+1}}</td>
<td>{{items}}</td>
</tr>
</table>
<br/>
<div>
Enter an Item to Add: <input type="text" ng-model="newItem">
<button ng-click="addItem()">Add Item</button>
</div>
<div>
Select an Item to Remove:
<select ng-model="selectItem" ng-options="item for item in
shoppingItems"></select>
<button ng-click="removeItem()">Remove Item</button>
</div>
</div>
</body>
</html>
Prgm3:
<!DOCTYPE html>
<html>
<title>
AJS Simple Calculator
</title>
<head>
<script type="text/javascript"
src="[Link]
[Link]">
</script>
<script>
var app=[Link]("calcApp",[]);
[Link]("calcCntrl",function($scope)
{
$scope.num1=0
$scope.num2=0
$[Link]=0
$[Link]="add"
$[Link]=function(){
switch($[Link]){
case 'add': $[Link]=$scope.num1 + $scope.num2
break
case 'sub': $[Link]=$scope.num1 - $scope.num2
break
case 'mul': $[Link]=$scope.num1 * $scope.num2
break
case 'div': if($scope.num2==0){
alert("Divide by zero error")
}
else{
$[Link]=$scope.num1/$scope.num2
}}}
});
</script>
</head>
<body ng-app="calcApp">
<h1>Angular JS Simple Calculator</h1>
<div ng-controller="calcCntrl">
Enter First Number: <input type="number" ng-model="num1">
Select Operator:<select ng-model="operator">
<option value="add">+</option>
<option value="sub">-</option>
<option value="mul">*</option>
<option value="div">/</option>
</select>
Enter Second Number:<input type="number" ng-model="num2">
<button ng-click="compute()">Compute</button>
<br/>
<b>{{num1 + " "+operator+ " "+ num2+ "="+result}}</b>
</div>
</body>
</html>
Prgm4:
<!DOCTYPE html>
<html>
<title>
Square and Factorial Application
</title>
<head>
<script type="text/javascript"
src="[Link]
[Link]">
</script>
<script>
var app=[Link]("mySqFct", []);
[Link]("mySqFctCntrl", function($scope){
$[Link]=0
$[Link]
$[Link]=function()
{
if($[Link]==0)
{
$[Link]=1
}
else{
$[Link]=1
for(var i=$[Link]; i>=1; i--)
{
$[Link]=$[Link]*i
}
$[Link]=$[Link]
}
}
$[Link]=function(){
$[Link]=$[Link]*$[Link]
}
});
</script>
</head>
<body ng-app="mySqFct">
<h1>Factorial and Square Application</h1>
<div ng-controller="mySqFctCntrl">
Enter the Number: <input type="number" ng-model="num">
<button ng-click="factorial()">Compute Factorial</button>
<button ng-click="square()">Compute Square</button>
<br/>
{{result}}
</div>
</body>
</html>
Prgm5:
<!DOCTYPE html>
<html>
<title>Student Details Application</title>
<head>
<script type="text/javascript"
src="[Link]
[Link]">
</script>
<script>
var app=[Link]("studDetailsApp",[]);
[Link]("studDetailsAppCntrl",function($scope){
$[Link]=[]
$[Link]=function()
{
$[Link]=[]
for(var i=1;i<=$[Link];i++)
{
var stud={
"SLNO":i,
"NAME":'Student-'+i,
"CGPA":([Link]()*10+1).toFixed(2)
}
$[Link](stud)
}
}
});
</script>
</head>
<body ng-app="studDetailsApp">
<h1>Student Details Application</h1>
<div ng-controller="studDetailsAppCntrl">
Enter the Number of Students to Generate the Data:
<input type="number" ng-model="num">
<button ng-click="generateData()">Generate</button>
<br/>
<table border="1" ng-show="[Link]>0">
<tr>
<th>SLNO</th>
<th>NAME</th>
<th>CGPA</th>
</tr>
<tr ng-repeat="student in studData">
<td>{{[Link]}}</td>
<td>{{[Link]}}</td>
<td>{{[Link]}}</td>
</tr>
</table>
<br/>
Number of Students={{[Link]}}
</div>
</body>
</html>
Prgm6:
<!DOCTYPE html>
<html>
<title>TO DO Application</title>
<head>
<script type="text/javascript"
src="[Link]
[Link]">
</script>
<script>
var app=[Link]("toDoApp",[]);
[Link]("toDoAppCntrl",function($scope){
$[Link]=[
{'TITLE':'Task-1','COMPLETED':true,'EDITING':false},
{'TITLE':'Task-2','COMPLETED':false,'EDITING':false},
{'TITLE':'Task-3','COMPLETED':false,'EDITING':false}
]
$[Link]=function(){
if($[Link])
{
var t={
'TITLE':$[Link],
'COMPLETED':false,
'EDITING':false
}
$[Link](t)
}
else{
alert("Please enter the task to add")
}
}
$[Link]=function(task)
{
[Link]=true
}
$[Link]=function(task){
[Link]=false
}
$[Link]=function(task)
{
var index=$[Link](task)
$[Link](index,1)
}
});
</script>
</head>
<body ng-app="toDoApp">
<h1>TO DO APPLICATION</h1>
<div ng-controller="toDoAppCntrl">
Enter the name of the Task:
<input type="text" ng-model="newTask">
<button ng-click="addTask()">Add Task</button>
<br/>
<br/>
<table border="1">
<tr>
<th>SLNO</th>
<th>Status</th>
<th>Task</th>
<th>Edit</th>
<th>Delete</th>
</tr>
<tr ng-repeat="task in tasks">
<td>{{$index+1}}</td>
<td>
<input type="checkbox" ng-model="[Link]">
</td>
<td>
<span ng-show="![Link]">{{[Link]}}</span>
<input type="text" ng-show="[Link]"
ng-model="[Link]" ng- blur="turnOffEditing(task)">
</td>
<td>
<button ng-click="editTask(task)">Edit</button>
</td>
<td>
<button ng-click="deleteTask(task)">Delete</button>
</td>
</tr>
</table>
</div>
</body>
</html>
Prgm7:
<html>
<title> USER MANAGEMANT SYSTEM</title>
<head>
<script type="text/javascript"
src="[Link]
></script>
<script>
var app=[Link]("userMngtApp",[]);
[Link]("userMgntCntrlApp",function($scope){
$[Link]=[
{'name':"[Link] Kumar BT",
'email':'harish123@[Link]','editing':false},
{'name':'abc','email':'abc@[Link]','editing':false},
{'name':'xyz','email':'xyz@[Link]','editing':false}
]
$[Link]=function()
{
if($[Link] && $[Link])
{
var u={
'name':$[Link],
'email':$[Link],
'editing':false
}
$[Link](u)
$[Link]=''
$[Link]=''
}
else
{
alert("Please Provide the user name and email id")
}
}
$[Link]=function(user)
{
[Link]=true
}
$[Link]=function(user)
{
[Link]=false
}
$[Link]=function(user)
{
var yes=confirm("are you sure you want to delete")
if(yes==true)
{
var index=$[Link](user)
$[Link](index,1)
}
}
});
</script>
</head>
<body ng-app="userMngtApp">
<h1> USER MANAGEMANT APPLICATION</h1>
<div ng-controller="userMgntCntrlApp">
Enter the User Name:<input type="text" ng-
model="newUserName">
Enter the Email Id:<input type="text" ng-
model="newUserEmail">
<button ng-click="createUser()">Create</button>
<br/>
<br/>
<table border="1">
<tr>
<th>SLNO</th>
<th>NAME</th>
<th>EMAIL</th>
<th>READ</th>
<th>UPDATE</th>
<th>DELETE</th>
</tr>
<tr ng-repeat="user in users">
<td>{{$index+1}}</td>
<td>
<span
ng-show="![Link]">{{[Link]}}</span> &n
bsp
<input type="text" ng-show="[Link]" ng-
model="[Link]">
</td>
<td>
<span ng-show="![Link]">{{[Link]}}</span>
<input type="text" ng-show="[Link]" ng-
model="[Link]">
</td>
<td>
<button ng-click="readUser(user)">Read</button>
</td>
<td>
<button ng-click="updateUser(user)">Update</button>
</td>
<td>
<button ng-click="deleteUser(user)">Delete</button>
</td>
</tr>
</table>
</div>
</body>
</html>
Prgm8:
<!DOCTYPE html>
<html>
<head>
<title>Angular JS Login Form</title>
<script
src="[Link]
></script>
<script>
var app = [Link]("loginApp", []);
[Link]('loginAppCntrl', function ($scope) {
$[Link] = '';
$[Link] = '';
$[Link] = 0;
$[Link] = function () {
if ($[Link] == "harish" && $[Link] ==
"12345678") {
alert("Login Successful");
} else {
$[Link]++;
if ($[Link] <= 3) {
alert("Incorrect username/password! Attempt No. " +
$[Link]);
} else {
[Link]("loginButton").disabled = true;
}
}
};
});
</script>
<style>
.error-message {
color: red;
font-size: 20px;
}
</style>
</head>
<body ng-app="loginApp" ng-controller="loginAppCntrl">
<h1>Angular JS Login Form</h1>
<form name="loginForm" ng-submit="login()">
Enter the User Name:
<input type="text" name="userName" ng-model="userName" ng-
minlength="5" ng-maxlength="8" required
placeholder="Enter User Name">
<span class="error-message" ng-show="[Link].
$[Link] && [Link].$dirty">User Name is
Required</span>
<span class="error-message" ng-show="[Link].
$[Link]">Minimum Length Must be 5</span>
<span class="error-message" ng-show="[Link].
$[Link]">Maximum username length is limited to 8</span>
<br/><br/>
Enter the Password:
<input type="password" name="password" ng-model="password" ng-
minlength="5" ng-maxlength="8" required
placeholder="Enter your password">
<span class="error-message" ng-show="[Link].
$[Link] && [Link].$dirty">Password is
required</span>
<span class="error-message" ng-show="[Link].
$[Link]">Minimum Password length is 5</span>
<span class="error-message" ng-show="[Link].
$[Link]">Maximum password length is limited to 8</span>
<br/><br/>
<button type="submit" ng-disabled="loginForm.$invalid"
id="loginButton">Login</button>
</form>
</body>
</html>
Prgm9:
<html>
<title>Angular JS Filter Employee Search Application</title>
<head>
<script type="text/javascript"
src="[Link]
></script>
<script>
var app=[Link]("empSearchApp",[]);
[Link]("empSearchAppCntrl",function($scope){
$[Link]=[
{'name':'Harish','salary':50000},
{'name':'Manju','salary':30000},
{'name':'Chethan','salary':70000},
{'name':'Prashanth','salary':50000},
{'name':'Narayan','salary':110000}
]
$[Link]=function()
{
$[Link]=''
$[Link]=''
}
});
</script>
</head>
<body ng-app="empSearchApp">
<h1>Employee Search Application</h1>
<div ng-controller="empSearchAppCntrl">
Search by Employee Name:<input type="text" ng-
model="searchName">
search by employee Salary:<input type="number" ng-
model="searchSalary">
<button ng-click="clearFilters()">ClearFilters</button>
<br/>
<h3>List of employees</h3>
<table border="1">
<tr>
<th>SLNO</th>
<th>EMP NAME</th>
<th>SALARY</th>
</tr>
<tr ng-repeat="emp in empList | filter:
{name:searchName,salary:searchSalary}">
<td>{{$index+1}}</td>
<td>{{[Link]}}</td>
<td>{{[Link]}}</td>
</tr>
</table>
</div>
</body>
</html>
Prgm10:
<html>
<title>Item Management Application</title>
<head>
<script type="text/javascript"
src="[Link]
>
</script>
<script>
var app=[Link]("itemMgmtApp",[]);
[Link]("itemMgmtAppCntrl",function($scope){
$[Link]=['Pen','Pencil','Eraser','Book']
$[Link]=function()
{
if($[Link])
{
if($[Link]($[Link])==-1)
{
$[Link]($[Link])
}
else{
alert('This item is already there in the item collection')
}
}
else{
alert('Please Enter the item to add')
}
}
$[Link]=function(item)
{
var yes=confirm("Are you sure you want to delete "+item)
if(yes==true)
{
var index=$[Link](item)
$[Link](index,1)
}
}
});
</script>
</head>
<body ng-app="itemMgmtApp">
<h1>Item Management Application</h1>
<div ng-controller="itemMgmtAppCntrl">
Enter an item to add: <input type="text" ng-model="newItem">
<button ng-click="addItem()">ADD</button>
<br/><br/>
<b>List of Items</b>
<table border="1">
<tr>
<th>SLNO</th>
<th>Item</th>
<th>Remove</th>
</tr>
<tr ng-repeat="item in itemList">
<td>{{$index+1}}</td>
<td>{{item}}</td>
<td><button
ng-click=removeItem(item)>Remove</button></td>
</tr>
</table>
<br/>
Total Number of Items=<b>{{[Link]}}</b>
</div>
</body>
</html>
Prgm11:
<html>
<title>Student Details in Uppercase</title>
<head>
<script type="text/javascript"
src="[Link]
>
</script>
<script>
var app=[Link]("studDetailsUpperApp",[]);
[Link]("studDetailsUpperAppCntrl",function($scope){
$[Link]=['harish','kumar','chetan','prashanth','thanuja']
$[Link]=true
$[Link]=false
$[Link]=function()
{
//[Link]('called')
$[Link]=false
$[Link]=true
}
$[Link]=function()
{
$[Link]=true
$[Link]=false
}
});
</script>
</head>
<body ng-app="studDetailsUpperApp">
<h1>Student Details in Uppercase</h1>
<div ng-controller="studDetailsUpperAppCntrl">
<button ng-click="Upper()">Upper</button>
<button ng-click="Lower()">Lower</button>
<table border="1">
<tr>
<th>SLNO</th>
<th>NAME</th>
</tr>
<tr ng-repeat="student in studDetails">
<td>{{$index+1}}</td>
<td ng-show="upper">{{student|uppercase}}</td>
<td ng-show="lower">{{student|lowercase}}</td>
</tr>
</table>
</div>
</body>
</html>
Prgm12:
<html>
<title>Date Application</title>
<head>
<script type="text/javascript"
src="[Link]
>
</script>
<script>
var app=[Link]("dateApp",[]);
[Link]("dateAppCntrl",function($scope){
$[Link]=new Date();
});
</script>
</head>
<body ng-app="dateApp">
<h1>Date in different formats</h1>
<div ng-controller="dateAppCntrl">
Current Date and Time: {{currentDate}}<br/>
Short Date: {{currentDate|date: 'short'}}<br/>
Long Date: {{currentDate |date: 'fullDate'}}<br/>
Medium Date:{{currentDate| date: 'medium'}}
</div>
</body>
</html>