Created
June 9, 2022 09:54
-
-
Save NetanelBasal/5f6a09209b59c8e8881114d6021df008 to your computer and use it in GitHub Desktop.
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
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; | |
@UntilDestroy() | |
@Directive({ | |
selector: '[copy]' | |
}) | |
export class CopyDirective { | |
@Input() copy: string; | |
constructor(private host: ElementRef<HTMLElement>) {} | |
ngOnInit() { | |
fromEvent(this.host.nativeElement, 'click').pipe( | |
untilDestroyed() | |
).subscribe(() => {}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment