Here I have created Recurring Deposit Calculator using angularjs and HTML5
<!DOCTYPE html>
<html>
<head>
<script
src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js">
</script>
<link rel="stylesheet"
href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<style>
#tbl ,th, td {
border: 1px solid grey;
padding: 5px;
}
#tbl
{
width:100%;
}
div
{
margin:5%;
width:500px;
}
.label
{
background-color: #707070;
}
#tbl tr:nth-child(odd) {
background-color: #f1f1f1;
}
#tbl tr:nth-child(even) {
background-color: #ffffff;
}
fieldset.scheduler-border {
border: 1px groove #ddd !important;
padding: 0 1.4em 1.4em 1.4em !important;
margin: 0 0 1.5em 0 !important;
-webkit-box-shadow: 0px 0px 0px 0px #000;
box-shadow: 0px 0px 0px 0px #000;
}
legend.scheduler-border {
font-size: 1.2em !important;
font-weight: bold !important;
text-align: left !important;
width:auto;
padding:0 10px;
border-bottom:none;
}
</style>
</head>
<body>
<div ng-app="myApp" ng-controller="rdCtrl">
<fieldset class="scheduler-border">
<legend class="scheduler-border">Rd Calculator</legend>
<form name="myForm" step="any" ng-model="formModel"
ng-submit="Calculate()" >
<table>
<tr>
<td>Monthly Installment(R) :</td>
<td><input type="number" step="any" class="form-control"
name="rdamount" ng-model="rdamount" required></td>
</tr>
<tr>
<td>Rate of Interest :</td>
<td><input type="number" step="any" class="form-control"
name="interestrate" ng-model="interestrate" required></td>
</tr>
<tr>
<td>Number of Months(n) : </td>
<td>
<select name="rdperiod" class="form-control" ng-model="rdperiod" >
<option data-ng-repeat="month in months" value="{{month.value}}">
{{month.text}}
</option>
</select>
</td>
</tr>
<tr>
<td>Maturity : </td>
<td>{{rdmaturity | number:2}}</td>
</tr>
<tr>
<td colspan="2">
<input type="submit" class="form-control btn btn-info" >
</td>
</tr>
</table>
</form>
</fieldset>
</div>
</body>
</html>
<script>
var app = angular.module('myApp', []);
app.controller('rdCtrl', function($scope) {
/****Initialisation at start ********/
$scope.rdamount= 3000;
$scope.interestrate = 8.7;
$scope.rdperiod = 3;
$scope.Calculate = function() {
$scope.interestrate1=$scope.interestrate/400;
$scope.quarter=$scope.rdperiod/3;
$scope.rdmaturity=
($scope.rdamount*[ (Math.pow((1+$scope.interestrate1),$scope.quarter))-1])/
( 1- Math.pow((1+$scope.interestrate1),-1/3));
}
$scope.months=[];
for(i=3;i<=120;i=i+3)
$scope.months.push({value:i,text:i});
});
</script>
No comments:
Post a Comment