ng-ytl-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
54 lines (44 loc) • 1.25 kB
text/typescript
import {
Component,
ContentChild,
ElementRef,
HostBinding,
HostListener,
Input,
TemplateRef,
ViewEncapsulation,
} from '@angular/core';
import { NzAnchorComponent } from './nz-anchor.component';
export class NzAnchorLinkComponent {
nzHref: string;
nzTitle: string;
nzTemplate: TemplateRef<void>;
active: boolean = false;
_onClick(): void {
this._anchorComp.scrollTo(this);
}
constructor(public el: ElementRef, private _anchorComp: NzAnchorComponent) {
this._anchorComp.add(this);
}
goToClick(e: Event): void {
e.preventDefault();
e.stopPropagation();
this._anchorComp.scrollTo(this);
// return false;
}
}