I want to create UI using "for" loop inside my html file, so that will not need to write all the html. This is my model class
export class Industries
{
alphaIndex: string = '';
industries: Array<string> = [];
constructor(alphaIndex: string, industries: string[]) {
this.alphaIndex = alphaIndex;
this.industries = industries;
}
}
This data I have added in above model class from component class
industries: Array<Industries> = [];
constructor() {
this.getIndustryData();
}
getIndustryData()
{
let recordAE = new Industries ('A-E',['Aerospace & Defense','Automotive','Banking', 'Capital Market','Enterprise Strategy']);
this.industries.push(recordAE);
let recordFO = new Industries ('FO',['Forest Products & Chemicals', 'Industrial','Insurance','Mining','Metals']);
this.industries.push(recordFO);
.....
}
This UI want to be repeated
<div class="col-md-2">
<div class="nav-item dropdown">
<a href="#" data-toggle="dropdown">Item.alphaIndex
<i class="bi bi-chevron-right"></i>
</a>
<div class="dropdown-menu">
<a href="#" class="dropdown-item">Item.Data</a>
</div>
</div>
</div>
How can I do that ?