mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-17 07:50:12 +01:00
Add "material theme link" component
This commit is contained in:
parent
d0b58820be
commit
f39f10c12d
18 changed files with 135 additions and 32 deletions
|
|
@ -0,0 +1,26 @@
|
|||
import { Component, ViewChild, AfterViewInit, Input } from '@angular/core';
|
||||
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
||||
import { NbPopoverDirective } from '@nebular/theme';
|
||||
|
||||
@Component({
|
||||
selector: 'ngx-material-theme-link',
|
||||
templateUrl: './material-theme-link.component.html',
|
||||
styleUrls: ['./material-theme-link.component.scss'],
|
||||
})
|
||||
export class MaterialThemeLinkComponent implements AfterViewInit {
|
||||
public showPopover: boolean = false;
|
||||
|
||||
@Input() public set withPopover(value: any) {
|
||||
this.showPopover = coerceBooleanProperty(value);
|
||||
}
|
||||
|
||||
@ViewChild(NbPopoverDirective, { static: true }) public popover: NbPopoverDirective;
|
||||
|
||||
public ngAfterViewInit(): void {
|
||||
this.showPopover && this.popover && this.popover.show();
|
||||
}
|
||||
|
||||
public hidePopover(): void {
|
||||
this.popover && this.popover.hide();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue