Topic: I have a problem with BOOTSTRAP TABS
Adrian Sawicki answered 7 years ago
public tabs: any[] = [
{title: 'Dynamic Title 1', content: 'Dynamic content 1', index: 1},
{title: 'Dynamic Title 2', content: 'Dynamic content 2', index: 2},
{title: 'Dynamic Title 3', content: 'Dynamic content 3', index: 3}
];
shown($event) {
for(let i = 0; i < this.tabs.length; i++) { this.tabs[i].active === true && this.tabs[i].index === 1 ? this.tabs[i].content = "new content when shown" : "there is no active tabs"};
}
HTML:
<!-- Tabset tabs -->
<tabset #staticTabs [buttonStyle]="'nav-tabs tabs-3 red'" [contentStyle]="'card'" (shownBsTab)="shown($event)" >
<tab heading="Static title">Static content</tab>
<tab ripple-radius *ngFor="let tabz of tabs"
[heading]="tabz.title"
[active]="tabz.active"
[index]="tabz.index"
(deselect)="tabz.active = false"
(select)="tabz.active = true"
[customClass]="tabz.className">
{{tabz?.content}}
</tab>
</tabset>
I've shown it just to let you see some of the possibility it gives. Of course, it still missing something but thanks to people like you, we can improve this project. Thanks for the suggestion, we will try to add more customization to it. sc_guy pro commented 7 years ago
Would you please add this to the documentation. Thanks.vizmedia pro answered 7 years ago
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- User: Pro
- Premium support: No
- Technology: General Bootstrap questions
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No