-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tabs): fixed tabs duplication issue (#1941)
fixed #1629 * fixed duplicate tab issue * removed automatic reselection of tabs if tab is destroyed * added tests for remove tab * added viewvchild to be able to call method * added detect changes call to fix unittests * fix(tabs): remove tab-content node if tab is destroyed * fix(tabs): fix ngIf error and change docs
- Loading branch information
Showing
12 changed files
with
108 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<div> | ||
<p>Access to static tab from component</p> | ||
<p> | ||
<button type="button" class="btn btn-primary btn-sm" (click)="selectTab(1)">Select second tab</button> | ||
<button type="button" class="btn btn-primary btn-sm" (click)="selectTab(2)">Select third tab</button> | ||
</p> | ||
<p> | ||
<button type="button" class="btn btn-primary btn-sm" (click)="disableEnable()"> | ||
Enable / Disable third tab | ||
</button> | ||
</p> | ||
<hr/> | ||
<tabset #staticTabs> | ||
<tab heading="Static title">Static content</tab> | ||
<tab heading="Static Title 1">Static content 1</tab> | ||
<tab heading="Static Title 2">Static content 2</tab> | ||
<tab heading="Static Title 3" removable="true">Static content 3</tab> | ||
</tabset> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Component, ViewChild } from '@angular/core'; | ||
import { TabsetComponent } from 'ngx-bootstrap'; | ||
|
||
@Component({ | ||
selector: 'demo-tabs-manual', | ||
templateUrl: './manual.html' | ||
}) | ||
export class DemoTabsManualComponent { | ||
|
||
@ViewChild('staticTabs') staticTabs: TabsetComponent; | ||
|
||
selectTab(tab_id: number) { | ||
this.staticTabs.tabs[tab_id].active = true; | ||
} | ||
|
||
disableEnable() { | ||
this.staticTabs.tabs[2].disabled = ! this.staticTabs.tabs[2].disabled | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters