Looking to assign the data with two possible values, depending on its existence. For instance, if I have a collection of TVs and I want to save the "name" value of myTVs[0] and myTVs[1].
For example:
var myTVs = [
{
"JapaneseTV":
{
"name":"Sony"
},
"TaiwaneseTV":{}
},
{
"JapaneseTV":{},
"TaiwaneseTV":
{
"name":"Samsung"
}
}
];
Is there an Angular method to connect the data using something like:
<p ng-repeat="tv in myTVs">{{tv.name}}</p>
where tv.name equals JapaneseTV.name || TaiwaneseTV.name; // Automatically selecting which one has a value.