I am working on converting an old Angular 1.X website to Angular 2 release 6. I've been creating a component class with corresponding html but i'm stuck at the point of displaying a json object inside of another json object. The json object I'm trying to display is
Details Obj :
{
"details":
{
"id": "36d610ed0c62bafd",
"Field Name": "FID,Shape,OID_,BankPositi",
"Geometry Type": "Point",
},
}
And the old code that displayed this was: HTML :
<div ng-show="vm.item.showDetails" ng-repeat="(key, val) in vm.item.details">
<p><span>{{key}}:</span>{{val}}</p>
</div>
Javascript :
vm.showDetails = function (entry) {
entry.showDetails = !entry.showDetails;
entry.numberOfWords = entry.showDetails ? config.search.showAll : config.search.numberOfWordsShown;
}
What I'm wondering is what is the best way to iterate through the json obj and display it.