0% found this document useful (0 votes)
21 views2 pages

Prog 5

The document describes a calculator application built with HTML, CSS, and AngularJS. It contains inputs to enter two numbers, a button to trigger a calculation, and displays to show the result of addition, subtraction, multiplication, and division. When the button is clicked, the Angular controller performs the calculations and binds the results to the display paragraphs.

Uploaded by

Mandira Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views2 pages

Prog 5

The document describes a calculator application built with HTML, CSS, and AngularJS. It contains inputs to enter two numbers, a button to trigger a calculation, and displays to show the result of addition, subtraction, multiplication, and division. When the button is clicked, the Angular controller performs the calculations and binds the results to the display paragraphs.

Uploaded by

Mandira Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

<html ng-app="prog3">

<head>
<script src="angular.min.js"></script>
<style type="text/css">
marquee{
color:aqua;
font-size: 30px;
}
h1{
font-size: 30px;
}
p{
color:white;
font-size: 20px;
}
input{
color:black;
font-size:20px;
}

</style>
</head>
<body bgcolor="red" ng-controller="ctrl">
<center>
<marquee scrollamount="10">Welcome to the Dept</marquee>
<h1>Calculator Using HTML and CSS with Angular JS </h1>
<p>Enter the first number: <input type="number" ng-model="num1"/></p>
<p>Enter the Second number: <input type="number" ng-model="num2"/></P>
<input type="button" value="compute" ng-click="myFunc()"/>

<p ng-bind="add"></p>
<p ng-bind="sub"></p>
<p ng-bind="mul"></p>
<p ng-bind="div"></p>
</center>
<script>
var app=angular.module('prog3',[]);
app.controller('ctr<html ng-app="prog3">
<head>
<script src="angular.min.js"></script>
<style type="text/css">
marquee{
color:aqua;
font-size: 30px;
}
h1{
font-size: 30px;
}
p{
color:white;
font-size: 20px;
}
input{
color:black;
font-size:20px;
}

</style>
</head>
<body bgcolor="red" ng-controller="ctrl">
<center>
<marquee scrollamount="10">Welcome to the Dept</marquee>
<h1>Calculator Using HTML and CSS with Angular JS </h1>
<p>Enter the first number: <input type="number" ng-model="num1"/></p>
<p>Enter the Second number: <input type="number" ng-model="num2"/></P>
<input type="button" value="compute" ng-click="myFunc()"/>

<p ng-bind="add"></p>
<p ng-bind="sub"></p>
<p ng-bind="mul"></p>
<p ng-bind="div"></p>
</center>
<script>
var app=angular.module('prog3',[]);
app.controller('ctrl',function($scope)
{
$scope.myFunc=function()
{
$scope.add=$scope.num1+$scope.num2;
$scope.sub=$scope.num1-$scope.num2;
$scope.mul=$scope.num1*$scope.num2;
$scope.div=$scope.num1/$scope.num2;
}
});
</script>

</body>
</html>l',function($scope)
{
$scope.myFunc=function()
{
$scope.add=$scope.num1+$scope.num2;
$scope.sub=$scope.num1-$scope.num2;
$scope.mul=$scope.num1*$scope.num2;
$scope.div=$scope.num1/$scope.num2;
}
});
</script>

</body>
</html>

You might also like