Created
June 3, 2017 18:57
-
-
Save stevermeister/ef76fa152c4b601166f008218bbd9409 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
export class TestComponent { | |
constructor(private renderer: Renderer2, | |
private element : ElementRef) { } | |
ngOnInit() { | |
this.clickSubscription = this.renderer.listen(this.element.nativeElement, "click", handler); | |
} | |
ngOnDestroy() { | |
this.clickSubscription.unsubscribe(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment