Create Simple Interest program in Angular JS

 Create a Simple Interest program in Angular JS:-

step 1st:-     Create HTML Form and add angular library

Step2nd:-   add ng-app and ng-controller under body section or <div>

step3rd:-     add angular event under button tag ng-click

step4th:-      define controller script using javascript

                  add module using ng-app attribute

                   var app = angular.modules('appname',[]);    [] means angular route ,default is null



   $scope is the global variable in angular js which can bind ng-model data under the controller block.

  it provides two-way data-binding from the controller to view and view to the controller.

Complete Solution of SI program?

<!DOCTYPE html>
    <script src=""> </script>
<div ng-app="myApp" ng-controller="myCtrl">
<input type="text" ng-model="p" />
<input type="text" ng-model="r" />
<input type="text" ng-model="t" />
<input type="button" value="calculate" ng-click="fun()">


<script type="text/javascript">
var app = angular.module('myApp',[]);
         $scope.res = (eval($scope.p)*eval($scope.r)*eval($scope.t))/100;






Post a Comment


POST Answer of Questions and ASK to Doubt

Post a Comment (0)