CopyPastor

Detecting plagiarism made easy.

Score: 0.8255384479981124; Reported for: String similarity Open both answers

Possible Plagiarism

Reposted on 2024-04-12
by Qiimiia

Original Post

Original - Posted on 2024-04-12
by Qiimiia



            
Present in both answers; Present only in the new answer; Present only in the old answer;

I would suggest using rxjs.
Add a global `clickSubscription: Subscription` in your component; then in `ngOnInit` you can do:
ngOnInit(): void { this.clickSubscription = fromEvent(document, 'click').subscribe(event => { console.log(event); }) }

and in `ngOnDestroy`:
ngOnDestroy(): void { this.clickSubscription.unsubscribe(); }

I would suggest using rxjs:
import { fromEvent, Subscription } from 'rxjs';
Add a global `clickSubscription: Subscription` in your component; then in `ngOnInit` you can do:
ngOnInit(): void { this.clickSubscription = fromEvent(document, 'click').subscribe(event => { console.log(event); }) }

and in `ngOnDestroy`:
ngOnDestroy(): void { this.clickSubscription.unsubscribe(); }



        
Present in both answers; Present only in the new answer; Present only in the old answer;