Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var app = angular.module('plunker', []);
- app.controller('MainCtrl', function($scope) {
- $scope.name = 'World';
- $scope.count = 0;
- $scope.total = function(count){
- var total =
- // I want to parseFloat the $scope.td1 + the current count.
- // How does the syntax look when you concat ng-model.
- parseFloat($scope.td1 + count || 0) +
- parseFloat($scope.td2 + count || 0) +
- parseFloat($scope.td3 + count || 0) +
- parseFloat($scope.td4 + count || 0) +
- parseFloat($scope.td5 + count || 0);
- return total || 0;
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement