Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. var app = angular.module('plunker', []);
  2.  
  3. app.controller('MainCtrl', function($scope) {
  4. $scope.name = 'World';
  5. $scope.count = 0;
  6.  
  7. $scope.total = function(count){
  8. var total =
  9. // I want to parseFloat the $scope.td1 + the current count.
  10. // How does the syntax look when you concat ng-model.
  11. parseFloat($scope.td1 + count || 0) +
  12. parseFloat($scope.td2 + count || 0) +
  13. parseFloat($scope.td3 + count || 0) +
  14. parseFloat($scope.td4 + count || 0) +
  15. parseFloat($scope.td5 + count || 0);
  16. return total || 0;
  17. }
  18. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement