ngOnInit() { this.data.currentMessage.subscribe((message) => { this.companyData = message; // remove previous tabs this.removeAll();
let count = 0; for (const company of this.companyData) { this.addNewTab( company.companyName, company.sicDesciption, count === 0 ? true : false ); count++; } }); }
addNewTab( companyName: string, description: string, activate: boolean ): void { const newTabIndex = this.tabs.length + 1; this.tabs.push({ title: companyName, content: description, disabled: false, removable: true, active: activate }); }
<div (click)="$event.preventDefault()">