I have this JSON (I did not create it and can not change it)
{"tags": [
{
"title": "news",
"options": [
{
"title": "important",
},
{
"title": "less important",
}
]
},
{
"title": "entertainment",
"options": [
{
"title": "entertainment",
}
]
}
I would like to display it as a list, where if a certain title hasonly one option then the title should be displayed in the list, and if a title has more than one item in options, then the main title should be displayed and the options titles should also be displayed. the final result (according to the above example) should display:
<ul>
<li>news<ul>
<li>important</li>
<li>less important</li>
</ul>
</li>
<li>entertainment</li>
</ul>
how can I do this in angularJS?