Here is the JSON data I'm working with:
{
"id": "026001",
"description": "Drop Forged Double Coupler",
"CASHCUST01": {
"hireRate": "0.01500",
"saleRate": "2.50000"
},
"SMITH00010": {
"hireRate": "0.02500",
"saleRate": "1.50000"
},
"imageUrl": "images/fitting.jpg"
}
This is how my controller looks like:
var userLogged = 'SMITH00010';
$scope.updateValue = function(qtd) {
$scope.newHireRate = $scope.product.{{userLogged}}.hireRate * qtd;
}
I need to display the correct price of the product based on the logged in user.
The current implementation is not functioning as expected. Can anyone suggest a solution?