Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html ng-app="sipApp">
<head>
<meta name="description" content="Put calculated amount in Display." />
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body ng-app='sipApp'>
  
  <div ng-controller="amountCtrl">
    <p>Amount will be visible once users fills amount and hits SUM button. And it should get the amount from SUM.</p>
    
    <p ng-show="true">Users Total: {{amountVal}}</p>
    
    <p>
      <input type="text" ng-model="amount">
      <button ng-click="calculateAmount(amount)">
        SUM
      </button>
    </p>
  </div><!-- amountCtrl -->
  
  <script>
    var sipApp = angular.module('sipApp', []);
    sipApp.controller('amountCtrl',
        function($scope){
          
          alert('amountCtrl');
          
            $scope.calculateAmount = function(amount){
              alert(1);
                $scope.amountFilled = true;
                $scope.amountVal = amount;
            };
        }
    );
  </script>
  
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers