Created
April 14, 2021 19:32
-
-
Save semagarcia/df4cef7c9349ba3f97cdcfc7443cd035 to your computer and use it in GitHub Desktop.
Option A: "standard way" => Class (in Angular example, use this snippet inside AfterViewInit lifecycle hook):
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
// OPTION A: "standard way" => Class | |
// In Angular example, use this snippet inside AfterViewInit lifecycle hook: | |
class MyAngularComponent implements AfterViewInit { | |
ngAfterViewInit() { | |
// Standard-way | |
document.querySelector('#clickCounter') | |
.addEventListener('counter-clicked', this.myCallbackFunction); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment