File
Metadata
selector |
ngx-theme-switcher |
styleUrls |
theme-switcher.component.scss |
templateUrl |
./theme-switcher.component.html |
showTitle
|
Type: boolean
Default value: true
|
|
popover
|
popover: NbPopoverDirective
|
Type : NbPopoverDirective
|
Decorators : ViewChild
|
|
switcherListComponent
|
switcherListComponent:
|
Default value : ThemeSwitcherListComponent
|
|
theme
|
theme: NbJSThemeOptions
|
Type : NbJSThemeOptions
|
|
import { Component, Input, ViewChild } from '@angular/core';
import { NbPopoverDirective } from '@nebular/theme';
import { NbJSThemeOptions } from '@nebular/theme/services/js-themes/theme.options';
import { ThemeSwitcherListComponent } from './themes-switcher-list/themes-switcher-list.component';
@Component({
selector: 'ngx-theme-switcher',
templateUrl: './theme-switcher.component.html',
styleUrls: ['./theme-switcher.component.scss'],
})
export class ThemeSwitcherComponent {
@ViewChild(NbPopoverDirective) popover: NbPopoverDirective;
@Input() showTitle: boolean = true;
switcherListComponent = ThemeSwitcherListComponent;
theme: NbJSThemeOptions;
}
<div class="themes-switcher"
[nbPopover]="switcherListComponent"
nbPopoverPlacement="bottom"
[nbPopoverContext]="{popover: popover}">
<i class="nb-drops"></i>
<span *ngIf="showTitle">Themes</span>
</div>
Legend
Html element with directive