Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>    
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
<script src="https://rawgit.com/angular/bower-angular/master/angular.min.js"></script>
<div ng-app="ReceiptsApp">
    <div ng-controller="ReceiptsController">
        <table class="tableData">
            <tr  ng-repeat="r in rvm" >
                <td>
                    <input type="text" lass="input-large" ng-model="r.val1" name="val1" />
                </td>
                <td>
                    <input type="text" lass="input-large" ng-model="r.val2" name="val2" />
                </td>
                <td>
                    <input type="text" lass="input-large" ng-model="result" name="res" />
                </td>
                <td>
                    <button type="button" class="btn btn-default" ng-click="addRow1($index)">Add</button>
                </td>
               
             
            </tr>
        </table>
       
    </div>
</div>
</div>
</body>
</html>
 
var ReceiptsApp = angular.module('ReceiptsApp', []);
ReceiptsApp.controller('ReceiptsController', function ($scope) {
 $scope.rvm = [{}];
   $scope.addRow1 = function (index) {
        //alert('ss');
       $scope.result = $scope.r.val1 - $scope.r.val2;
        if ($scope.rvm.length == (index + 1)) {
            $scope.rvm.push({
            });
        }
        
    }
    
   
});
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers