I'm new to AngularJS and I'm still exploring its possibilities. Currently I'm stuck with this problem: How can I name a variable using another's variable value?
For example I have something like this in my controller:
$scope.item_foo = 'Foo';
$scope.item_bar = 'Bar';
I can access the values with this:
{{item_foo}}
{{item_bar}}
So far so good, but now I want to display them dynamically. I have an object with 'foo' and 'bar' and I loop it with ngRepeat. How can I do something like that:
{{item_{{variable_with_value_foo_or_bar}}}} // should print Foo and Bar
Thank you for any of your help!