How can I change this in my controller
types = {
'fru': 'Fruits',
'veg': 'Vegetables',
};
in a way that allows me to do this in my view (a)
<span class="value">{{ types['fru'] }}</span>
and this in my view (b)
<div *ngFor="let value of types">
{{ value }}
</div>
?
At the moment, (a) works fine, and (b) throws "ERROR Error: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays."
I understand that my object cannot be iterated over. My question is, is there a way to change my object in my controller to another data structure in order to be able to achieve both desired functionalities in my view?