-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tabset): ability to provide template as tab label (#2829)
- Loading branch information
Showing
9 changed files
with
76 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Directive, TemplateRef } from '@angular/core'; | ||
|
||
@Directive({ | ||
selector: '[nbTabTitle]', | ||
}) | ||
export class NbTabTitleDirective { | ||
constructor(public templateRef: TemplateRef<any>) {} | ||
} |
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
16 changes: 16 additions & 0 deletions
16
src/playground/with-layout/tabset/tabset-template-title.component.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,16 @@ | ||
<nb-card> | ||
<nb-card-body> | ||
<nb-tabset> | ||
<nb-tab> | ||
<ng-template nbTabTitle> | ||
<span>Orders</span> | ||
</ng-template> | ||
<p>List of <strong>orders</strong>.</p> | ||
</nb-tab> | ||
<nb-tab> | ||
<span *nbTabTitle>Transactions</span> | ||
<p>List of <strong>transactions</strong>.</p> | ||
</nb-tab> | ||
</nb-tabset> | ||
</nb-card-body> | ||
</nb-card> |
20 changes: 20 additions & 0 deletions
20
src/playground/with-layout/tabset/tabset-template-title.component.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,20 @@ | ||
/** | ||
* @license | ||
* Copyright Akveo. All Rights Reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*/ | ||
|
||
import { ChangeDetectionStrategy, Component } from '@angular/core'; | ||
|
||
@Component({ | ||
templateUrl: './tabset-template-title.component.html', | ||
styles: [ | ||
` | ||
:host nb-tab { | ||
padding: 1.25rem; | ||
} | ||
`, | ||
], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class TabsetTemplateTitleComponent {} |
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