I want to represent ODF(Optical Distribution Frame) as gridView in angular let's say we have 24 ports ODF
export class TestComponent implements OnInit {
constructor(private bbService: BackboneService) {}
ports: any[] = [];
ngOnInit(): void {
this.bbService.getODFs().subscribe((data) => {
console.log(data);
this.ports = JSON.parse(data[0].ports);
});
}
}
inside html component
<table>
// if the port number reaches 12 it goes to next row
<tr>
<td *ngFor="let port of ports">port.number</td>
<tr/
</table
Output will be like that: