Trying to use ng-repeat
for an array of strings. I have 2 scenarios, 1 where it works, the other where it does not. My question is why doesn't it work?
The family types are are displayed accordingly in this situation: working
<div ng-controller="productsController as product">
<ul>
<li ng-repeat="family in product.families | orderBy: 'category'">
<ul>
<li ng-repeat="type in family.types">{{type}}</li>
</ul>
</li>
</ul>
</div>
However, in this situation they are not being displayed: not-working why?
<div ng-controller="productsController as product">
<ul>
<li ng-repeat="family in product.families | orderBy: 'category'">
</li>
</ul>
<ul>
<li ng-repeat="type in product.families.types">{{type}}</li>
</ul>
</div>
What would be the proper way to repeat types in this situation?
JSON
"families": [
{
"category": "Tablets",
"types": ["type1", "type2", "type3", ...]
}
]