forked from valor-software/ngx-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tabs): adding tab content to DOM just if selected tab (valor-soft…
- Loading branch information
Showing
9 changed files
with
88 additions
and
10 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
demo/src/app/components/+tabs/demos/dynamic-insert/dynamic-insert.html
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,5 @@ | ||
<tabset [dynamic]="true"> | ||
<tab heading="Title" id="tab1">Dynamic insert content</tab> | ||
<tab heading="Title 1">Dynamic insert content 1</tab> | ||
<tab heading="Title 2">Dynamic insert content 2</tab> | ||
</tabset> |
7 changes: 7 additions & 0 deletions
7
demo/src/app/components/+tabs/demos/dynamic-insert/dynamic-insert.ts
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,7 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'demo-tabs-dynamic-insert', | ||
templateUrl: './dynamic-insert.html' | ||
}) | ||
export class DemoTabsDynamicInsertComponent {} |
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 |
---|---|---|
@@ -1,15 +1,23 @@ | ||
<ul class="nav" [ngClass]="classMap" (click)="$event.preventDefault()"> | ||
<li *ngFor="let tabz of tabs" [ngClass]="['nav-item', tabz.customClass || '']" | ||
[class.active]="tabz.active" [class.disabled]="tabz.disabled"> | ||
<li *ngFor="let tabz of tabs" | ||
[ngClass]="['nav-item', tabz.customClass || '']" | ||
[class.active]="tabz.active" | ||
[class.disabled]="tabz.disabled"> | ||
<a href="javascript:void(0);" class="nav-link" | ||
[attr.id]="tabz.id ? tabz.id + '-link' : ''" | ||
[class.active]="tabz.active" [class.disabled]="tabz.disabled" | ||
(click)="tabz.active = true"> | ||
[class.active]="tabz.active" | ||
[class.disabled]="tabz.disabled" | ||
(click)="selectTab(tabz)"> | ||
<span [ngTransclude]="tabz.headingRef">{{ tabz.heading }}</span> | ||
<span *ngIf="tabz.removable" (click)="$event.preventDefault(); removeTab(tabz);" class="bs-remove-tab"> ❌</span> | ||
<span *ngIf="tabz.removable" (click)="$event.preventDefault(); removeTab(tabz);" class="bs-remove-tab"> | ||
❌ | ||
</span> | ||
</a> | ||
</li> | ||
</ul> | ||
|
||
<div class="tab-content"> | ||
<ng-content></ng-content> | ||
<ng-container *ngIf="!dynamic"> | ||
<ng-content></ng-content> | ||
</ng-container> | ||
</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