Created
August 28, 2021 07:47
-
-
Save Mayankgupta688/66fc4f356611cc940bea9c65b9b15048 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 { Component, HostListener } from "@angular/core"; | |
@Component({ | |
selector: "app-root", | |
template: ` | |
<div> | |
<h1>This is Application Header</h1> | |
<h2>This is Other Header Component</h2> | |
</div> | |
`, | |
styleUrls: ["./app.component.css"] | |
}) | |
export class AppComponent { | |
title = "host-listener"; | |
color: string = "red"; | |
@HostListener("click", ["$event"]) | |
onScroll(event) { | |
console.log("User Clicked on Window..." + event.target.tagName); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment