I have an array called 'things' that contains different objects. For example, two different objects are as follows:
{name: 'book',
value: '5',
color: 'blue'}
and
{name:'pen',
length: '10'}
Now my goal is to display all these objects in a dropdown list using 'ng-options'. I can achieve this by using the following code:
ng-options="(thing.name + ', ' + thing.value + ', ' + thing.color)" for thing in things"
While this works well for displaying information about a 'book' object, it becomes messy when dealing with a 'pen' object. Is there a way to distinguish between the objects I want to display in the dropdown list or perhaps a better approach to handling this situation?