Angular's New Output API: Emit notifications from your child components

  Рет қаралды 3,648

Deborah Kurata

2 ай бұрын

In Angular, we often need our child component to emit notifications to its parent component. Previously, we've used @Output properties for these notifications.
Starting in Angular version 17.3, we now have a new output API. Note that the new output is NOT a signal. So why did the Angular team define a new output API as part of its signal-ification of Angular?
In this video, we examine the new output API and outline its benefits.
*Links*
KZbin video "Angular's New Signal Inputs": kzbin.info/www/bejne/r5umlpSfjL12Zrc
KZbin video "Angular's New Model Inputs: Two-way Communication with your Child Components": kzbin.info/www/bejne/nKO7enWBpt-HgZI
Code: stackblitz.com/edit/output-deborahk
*Content*
00:00 Angular's new output API
01:18 Sample application
02:29 @Output property
04:07 Receiving notifications from the child component
05:58 Using the new output API
06:57 Aliasing an output
07:39 Using an effect to emit the notification
08:47 Benefits of the new output API
09:27 Wrap up
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
😊About Me
Hey! I'm Deborah Kurata
I'm a software developer and KZbin content creator. I speak at conferences such as VS Live and ng-conf. I write articles for freeCodeCamp. And I'm a Pluralsight author with courses in the top 10 most popular (out of 7,000+) over the past 5 years. For my work in support of software developers, I've been recognized with the Microsoft Most Valuable Professional (MVP) award, and I'm a Google Developer Expert (GDE).
Contact me on Twitter: DeborahKurata
Find my Pluralsight courses: www.pluralsight.com/profile/author/deborah-kurata
Access my freeCodeCamp articles: www.freecodecamp.org/news/author/deborah-kurata/
View my KZbin content: www.youtube.com/@deborah_kurata
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
#angular
#bestpractices
#angulartutorial
#angularparentchild
#componentcommunicationinAngular
#angularcomponentcommunication
#angularcomponentinteraction
#angularsignalinputs
#outputAPIsangular
#angular17.3output
#angularoutput
#angularnewoutputapi
#angularoutputproperty
#outputdecorator

Пікірлер: 58
@towercontrol4450
@towercontrol4450 2 ай бұрын
By far the best angular tutorials I ever seen! Simple and easy!
@deborah_kurata
@deborah_kurata 2 ай бұрын
Wow, thanks! 😊
@ronaldobicca7101
@ronaldobicca7101 2 ай бұрын
Deborah, awesome video! Not a surprise. You are fantastic. Thank you so much.
@deborah_kurata
@deborah_kurata 2 ай бұрын
That is so kind of you to say. 😊 Thank you!
@youssefchaygani8518
@youssefchaygani8518 2 ай бұрын
Awesome explanation, let's see if the Angular team is thinking about HostListener and HostBinding decorators consistency as well.
@cachabacha03ify
@cachabacha03ify 2 ай бұрын
great video Deborah, thank youuuu
@deborah_kurata
@deborah_kurata 2 ай бұрын
😊
@vijay_explorer
@vijay_explorer 2 ай бұрын
Wow that's an awesome explanation, loved it!!
@deborah_kurata
@deborah_kurata 2 ай бұрын
Thank you so much!
@message59
@message59 2 ай бұрын
thank you so much for all your videos you have been a great help from the beginning ☺👌
@deborah_kurata
@deborah_kurata 2 ай бұрын
Happy to hear that! Thank you!
@alexanderlemberger5412
@alexanderlemberger5412 Ай бұрын
Its the most intelligent and beautiful explanation on these new topics of signals. Thank you so much, you made my day :)))
@deborah_kurata
@deborah_kurata Ай бұрын
That is kind of you so say. Thank you! 😊
@sunil24sunil
@sunil24sunil Ай бұрын
Your awesome keeping doing more stuff of all 🙏
@deborah_kurata
@deborah_kurata Ай бұрын
Thank you so much! 😊
@behzadkhosravanimajd
@behzadkhosravanimajd 2 ай бұрын
Thank you, Master Deborah Kurata, for your generosity in sharing. God Bless.
@deborah_kurata
@deborah_kurata 2 ай бұрын
Thank you for watching! 😊
@LarsRyeJeppesen
@LarsRyeJeppesen 2 ай бұрын
We just went zoneless with our app - amazing!
@deborah_kurata
@deborah_kurata 2 ай бұрын
Congrats!
@SirWilliamWalker
@SirWilliamWalker 2 ай бұрын
Great video!
@deborah_kurata
@deborah_kurata 2 ай бұрын
Thanks!
@techwake360
@techwake360 2 ай бұрын
that was awesome, Thanks
@deborah_kurata
@deborah_kurata 2 ай бұрын
Thanks! 😊
@louisant1817
@louisant1817 2 ай бұрын
Awesome content
@deborah_kurata
@deborah_kurata 2 ай бұрын
THANKS!
@Saaad2
@Saaad2 2 ай бұрын
Why you stopped creating Angular courses for PluralSight? Your Getting Started course was the best, haven't seen any such course anywhere and not only on React but I learnt other frameworks and libs too and no one is closer to your course. I just checked recently and your courses were marked as retired.
@deborah_kurata
@deborah_kurata 2 ай бұрын
Thank you for the kind words! It is definitely not by my choice.😥 Pluralsight will not allow me to update that course. They tell me that with the "Angular Fundamentals" course that my course was irrelevant. I *am* still doing courses for Pluralsight. I recently did this course: www.pluralsight.com/library/courses/rxjs-angular-signals-fundamentals
@Saaad2
@Saaad2 2 ай бұрын
Thank you for responding me@@deborah_kurata The only reason I used and ever paid PluralSight was because of your Angular course.. your Getting Started course is such a comprehensive course which covered so much about Angular. Quick question: As Angular gets new version every 6 months and that course hasn't been updated recently, would you recommend anyone to take your Getting Started course even as it is marked as retired?
@deborah_kurata
@deborah_kurata 2 ай бұрын
It depends. Often companies aren't on the most recent version of Angular, so depending on your project, learning Angular with v14 may be useful. It also does cover many of the basic concepts you'll need. The "coding along" is a bit more challenging because if you install the Angular CLI, you'll get Angular v17 and not everything in the course is compatible with v17. Sometimes, it's just little differences. (For example, the Angular team implemented a new code compiler, so you no longer need a '~' in your style file paths.) But these little things can cause new developers to stumble when "coding along". Just watching the course (not "coding along") does provide a good base set of knowledge for using Angular.
@Saaad2
@Saaad2 2 ай бұрын
@@deborah_kurata Thank you so much for your time!
@austinZen8800
@austinZen8800 9 күн бұрын
Thanks!
@deborah_kurata
@deborah_kurata 9 күн бұрын
Thank you so very much! 😊
@richarddefortune1329
@richarddefortune1329 2 ай бұрын
My understanding is that effect() is still in experimental stage. Otherwise, I see myself reverting back to ngOnIni() or computed value just to process a side-effect. Thanks again for the video.
@deborah_kurata
@deborah_kurata 2 ай бұрын
Yes, effect is still in developer preview: angular.io/api/core/effect
@SachalChandio
@SachalChandio 2 ай бұрын
you are doing awesome job at reviving this dead framework
@deborah_kurata
@deborah_kurata 2 ай бұрын
The reports of its death are greatly exaggerated! 😄
@chellaack1644
@chellaack1644 2 ай бұрын
Mam your video is awesome and outstanding .no words to express my thanks.Mam can you please post a video in ngrx without lazy loading
@deborah_kurata
@deborah_kurata 2 ай бұрын
Thank you for the kind words. I'll add "more NgRx" videos to my list of future topics. 😊
@chellaack1644
@chellaack1644 2 ай бұрын
@@deborah_kurata Thank you so much Mam
@igorr4682
@igorr4682 2 ай бұрын
What about if you have more than one signal and want to use the effect function ? In react you can add dependency array that will tell what state this effect should react to
@deborah_kurata
@deborah_kurata 2 ай бұрын
Yes, an effect can reference any number of signals and a change to any of them will trigger the effect.
@salemhusseinidev
@salemhusseinidev 2 ай бұрын
Heyya, awesome video as always. I’m wondering though, incase of needing to get the filtered list from an API, how would you go about denouncing it?
@deborah_kurata
@deborah_kurata 2 ай бұрын
Thank you! I assume you mean debouncing? There are outputToObservable() and outputFromObservable() functions. Those are great topics for another video!
@deborah_kurata
@deborah_kurata 2 ай бұрын
I put together an example here: stackblitz.com/~/edit/outputfromobservable-deborahk I'll do a post about it soon.
@salemhusseinidev
@salemhusseinidev 2 ай бұрын
@@deborah_kurata Sorry for the typo :) and thank you very much for the quick reply, nice and clear. All the best :)
@ANTONZUBAREV
@ANTONZUBAREV 2 ай бұрын
thanks. And can you show us how to use debounce inside the effect method correctly?
@deborah_kurata
@deborah_kurata 2 ай бұрын
I put together an example here: stackblitz.com/~/edit/outputfromobservable-deborahk I'll do a post about it soon.
@burak63783
@burak63783 2 ай бұрын
Thanks for the video. Can u tell me why u create a filterEff variable instand use the effect inside the constructor? 8:44 What are the benefits?
@deborah_kurata
@deborah_kurata 2 ай бұрын
Thank you for watching! Personally, I like to be declarative and declare effects as variables. It also allows you to built your own manual cleanup should you want to (using the variable). But primarily it is a personal style.
@burak63783
@burak63783 2 ай бұрын
@@deborah_kurata I love this style. Never see it before. Do u have more styles for me 🤓
@angelocolacicco997
@angelocolacicco997 2 ай бұрын
so, what's the difference between signal output and signal model? they look the same
@deborah_kurata
@deborah_kurata 2 ай бұрын
Model inputs are a signal and allows for two way binding. The parent can pass a value to the child. If the child modifies the value, the changed value is passed back to the parent. CHILD: value = model(0); PARENT: The output API is NOT a signal, it's an event. It is a one-way notification from the child to the parent. It allows for event binding so the parent can react to that event. CHILD: onChange = output(); PARENT:
@qwertymuzaffar
@qwertymuzaffar 2 ай бұрын
What if we use computed signal instead of effect, Will this work ?
@deborah_kurata
@deborah_kurata 2 ай бұрын
The purpose of the output API is to send events from the child component back to the parent component, providing notifications. If you need a value (or computed), you're better off using model inputs. Have you see that video? kzbin.info/www/bejne/nKO7enWBpt-HgZI
@Nabulio85
@Nabulio85 2 ай бұрын
I love the way you explain things. Thx 🫶
@deborah_kurata
@deborah_kurata 21 күн бұрын
Thank you so much!
@mateuszkowalski4987
@mateuszkowalski4987 Ай бұрын
Great video!
@deborah_kurata
@deborah_kurata Ай бұрын
Thank you! 😊
Secret Experiment Toothpaste Pt.4 😱 #shorts
00:35
Mr DegrEE
Рет қаралды 34 МЛН
Я обещал подарить ему самокат!
01:00
Vlad Samokatchik
Рет қаралды 7 МЛН
Здесь упор в процессор
18:02
Рома, Просто Рома
Рет қаралды 435 М.
$1 vs $100,000 Slow Motion Camera!
0:44
Hafu Go
Рет қаралды 28 МЛН
Хакер взломал компьютер с USB кабеля. Кевин Митник.
0:58
Последний Оплот Безопасности
Рет қаралды 1,7 МЛН