Skip to content

Instantly share code, notes, and snippets.

@NetanelBasal
Created June 9, 2022 09:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NetanelBasal/5f6a09209b59c8e8881114d6021df008 to your computer and use it in GitHub Desktop.
Save NetanelBasal/5f6a09209b59c8e8881114d6021df008 to your computer and use it in GitHub Desktop.
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