ngx-admin/docs/app/shared/components/material-theme-link/material-theme-link.component.ts

27 lines
838 B
TypeScript
Raw Normal View History

2020-03-12 13:31:36 +03:00
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();
}
2020-03-25 19:07:02 +03:00
}