I attempted to retrieve a value from two dynamic objects using AngularJS.
<div ng-controller="SampleController">
<div> {{item['111']['price']}}
</div>
within the SampleController
$scope.item={111:{price:"232"},112:{price:"233"},115:{price:"237"}};
Currently, I have hardcoded item['111']['price']. If I want to receive the value dynamically from another source, how can I achieve that? For example,
<div ng-controller="SampleController">
<div> {{item[{{ItemId['id']}}]['price']}}
</div>
$scope.ItemId={id:111};
$scope.item={111:{price:"232"},112:{price:"233"},115:{price:"237"}};
However, this is giving an error. I also tried with route scope. Can anyone provide assistance?