Hi,
Angular directives are not supported inside jqxTabs.
To have dynamic tabs you may create jqxTabs, this way:
app.component.ts:
import { AfterViewInit, Component, ViewChild } from ‘@angular/core’;
import { jqxTabsComponent } from ‘jqwidgets-ng/jqxtabs’;
@Component({
selector: ‘app-root’,
templateUrl: ‘./app.component.html’,
})
export class AppComponent implements AfterViewInit{
@ViewChild(‘tabs’) tabs!: jqxTabsComponent;
data = [‘First’, ‘Second’, ‘Third’];
ngAfterViewInit(): void {
console.log(this.tabs);
this.tabs.removeFirst();
this.data.forEach(e => {
this.tabs.addLast(e, Content of ${e}
)
})
}
addTab() {
this.tabs.addLast(‘forth’, Content of forth
)
}
}
app.component.html:
<button (click)=”addTab()”>Add Tab</button>
<jqxTabs #tabs [width]=”500″ [height]=”200″>
<ul style=”margin-left:10px;”>
<div></div>
</jqxTabs>
Best regards,
Svetoslav Borislavov
jQWidgets Team
https://www.jqwidgets.com/