I am trying to gather values using angularJS and do some math with them. I have tried the following but did not work, I am very new at angularJS and I have a jsFiddle (I dont know how to get angularJS working on JSFiddle)
Does anyone know what I am doing wrong?
Here is my code:
<body ng-app="myApp" ng-controller="WizardController">
<wizard on-before-step-change="log(event)" on-step-changing="log(event)" on-after-step-change="log(event)">
<step title="stepOne">
<input type="text" ng-model="user.a" />
<input type="text" ng-model="user.b" />
<input type="text" ng-model="user.c" />
{{totalNumber}}
</step>
</wizard>
</body>
var myApp = angular.module('myApp', []);
myApp.controller('WizardController', ['$scope', function($scope){
$scope.user = { };
$scope.totalNumber = $scope.user.a * $scope.user.b * 50 + $scope.user.c - $scope.user.a;
}]);
if I do $scope.totalNumber = $scope.user, and then {{totalNumber}} i get this returned: {"a":"1"} (if I have <input type="text" ng-model="user.a">) but when I do $scope.user.a nothing displays this is very frusturating