I have json result like this
{
"modelList":["modelName1","modelName2"],
"modelNamesList":["modelName1","modelName2"],
"yearList":["2021","2020","2019","2018"]
}
I need only years list from above object so I am not getting how to do that, can anyone help me, thank you
I have done something like this
home.component.ts
export class HomeComponent implements OnInit {
catlogData: any ={
"modelList":["modelName1","modelName2"],
"modelNamesList":["modelName1","modelName2"],
"yearList":["2021","2020","2019","2018"]
};
ngOnInit(): void {}
home.component.html
<ul *ngFor="let a of catlogData">
<li>year:{{a.yearList[i]}}
</li>
</ul>