Is there a simple way in Angular to display the label of an item from an array without looping through it? I have an array of color options:
$scope.colors=[
{id:"0",label:"blue"},
{id:"1",label:"red"},
{id:"2",label:"green"}
]
And my data object stores the id of a selected color option:
$scope.data={
color:"1",
otherproperty:""
}
Instead of displaying the id, I want to show the label to the user. Is there an easy (angular) way to achieve this?
{{data.color.label}}