JSFiddle - React, Tailwind, and code Playground

by Sajeetharan Sinnathurai

HTML

<!DOCTYPE html>
<html ng-app="myApp">

  
    <script data-require="[email protected]" data-semver="1.5.8" src="https://code.angularjs.org/1.5.8/angular.js"></script>
    <link rel="stylesheet" href="style.css" />
    <script src="script.js"></script>
  

  <body data-ng-controller="myController">
   <input type="text" ng-model="amount1" ng-blur="amountchange()" />
 {{total}}
  </body>

</html>

JavaScript

// Code goes here

angular.module('myApp', []);

angular.module('myApp').controller('myController', function($scope) {
 
 $scope.total=200;
    
    
    $scope.amountchange = function () {
     debugger;
            if ($scope.total != NaN && $scope.amount1 !="") {
                $scope.total = parseInt($scope.amount1) + parseInt($scope.total);
                console.log($scope.amount);
            } 
           
            else if ($scope.amount1 == ""){          
                $scope.total = 200;
            }
        }
})