4 Ways to Listen to Events in Angular











############################# Video Source: www.youtube.com/watch?v=IBuZv_WmyrE

Sometimes we need to react to certain events in the browser and write code against them within our Angular applications. Maybe we need to listen to something like a click, input change, focus, or blur for example. Or maybe we need to do something crazy like listen for a click anywhere within the document from within an Angular component. Well, in this video we'll cover four common ways to accomplish this. First, we’ll use simple event binding to listen to some input events. Then well use the @HostListener decorator to listen to events on the host element of an Angular directive. After that we'll create a custom event on our directive using an Angular @Output and EventEmitter. And finally, we'll use the Angular Renderer2 listen function to listen to events outside of the component itself. Alright, let’s get to it! • ------------------------------------------------------------------------------ • ๐Ÿ‘• Be the coolest developer in the room with these Angular tees! (https://www.teepublic.com/user/dev-drip) • ------------------------------------------------------------------------------ • ๐Ÿ”— Demo Link: • https://stackblitz.com/edit/stackblit... • ------------------------------------------------------------------------------ • ๐Ÿ“– Chapters: • 0:00 – Introduction • 0:42 – Using Angular event binding • 2:20 – Using the @HostListener decorator on a directive • 3:55 – Using a custom event with an @Output and EventEmitter • 5:16 – Using the Renderer2 listen() Method • ------------------------------------------------------------------------------ • #angular #angulartutorial #angularcourse

#############################









Content Report
Youtor.org / Youtor.org Torrents YT video Downloader ยฉ 2024

created by www.mixer.tube