Can anyone help me figure out how to calculate the total fees in this example?
$scope.fees = {
basic: 1,
premium: 2,
total: this.basic + this.premium
}
I'm getting an error that says this
is undefined. Is there a better way to do this without repeating
$scope.fees.basic + $scope.fees.premium
for total?
If there's a more concise method, please let me know.
UPDATE: I realized I need to define the total
property outside of $scope.fees
. Like this: $scope.fees.total = ...