Angular's New Signal Inputs

  Рет қаралды 6,183

Deborah Kurata

Deborah Kurata

Күн бұрын

In Angular, we often need our parent components to communicate with their child components. And we've used @Input properties for that communication. Starting in Angular version 17.1, we now have signal-based inputs as an alternative to @Input properties. That makes it easier to react to changes to those inputs.
In this video, we examine the new signal inputs feature and outline its benefits.
Links
KZbin video "Angular's New Template Syntax: Control Flow": • Angular's New Template...
Code: stackblitz.com/edit/signal-in...
Content
00:00 Signal inputs in Angular
00:30 Sample application
01:40 @Input property
03:00 Computed signals
04:43 Passing data to a child component
06:19 Using a signal input
07:14 Transforming a signal input
08:22 Aliasing a signal input
08:55 Required signal input
09:54 Benefits of signal inputs
10:32 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/a...
Access my freeCodeCamp articles: www.freecodecamp.org/news/aut...
View my KZbin content: / @deborah_kurata
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
#angular
#bestpractices
#angulartutorial
#angularparentchild
#componentcommunicationinAngular
#angularcomponentcommunication
#angularsignalinputs
#signalinputsangular
#angular17.1signalinputs
#angularsignalinputrequired
#angularsignaltutorial
#angularinput
#angularinputtransformation

Пікірлер: 60
@GuillermoArellano
@GuillermoArellano 3 ай бұрын
I am always learning something new from Deborah. Thank you!
@deborah_kurata
@deborah_kurata 3 ай бұрын
That's so nice of you to say. Thank you.
@rahulxdd
@rahulxdd 3 ай бұрын
Great video to understand signal based inputs. Thank you for including the stackblitz.
@deborah_kurata
@deborah_kurata 3 ай бұрын
Glad it was helpful! 😊
@cristobalcanas5189
@cristobalcanas5189 3 ай бұрын
I love your content. Great video! Angular 17 is rocking
@deborah_kurata
@deborah_kurata 3 ай бұрын
Awesome, thank you! Angular is getting better and better!
@caseyspaulding
@caseyspaulding 3 ай бұрын
Thank you!
@joeyvico
@joeyvico 3 ай бұрын
Wonderful tutorial, as usual Deborah
@deborah_kurata
@deborah_kurata 3 ай бұрын
Thank you! 😊
@AntonioSantana-ll8il
@AntonioSantana-ll8il 3 ай бұрын
Excellent video!!
@deborah_kurata
@deborah_kurata 3 ай бұрын
Thank you very much!
@renrenklein_th
@renrenklein_th 3 ай бұрын
Well I learned something new from this, great as always. Thanks ^_^
@deborah_kurata
@deborah_kurata 3 ай бұрын
Glad to hear it it was useful. Thank you! 😊
@yojanmorales
@yojanmorales 3 ай бұрын
clear as water, I love these videos
@deborah_kurata
@deborah_kurata 3 ай бұрын
Thank you so much!
@gabrielporto3936
@gabrielporto3936 3 ай бұрын
I'm new here and i was very very impressed with yours videos Deborah, thank you!
@deborah_kurata
@deborah_kurata 3 ай бұрын
Glad you like them! 😊
@deepakkumarmohapatra4760
@deepakkumarmohapatra4760 18 күн бұрын
just wow, thanks Deborah🤩
@deborah_kurata
@deborah_kurata 16 күн бұрын
Thank you!
@ashishnayak2666
@ashishnayak2666 2 ай бұрын
Excellent. Clear explanation 👌 👏 👍
@deborah_kurata
@deborah_kurata 2 ай бұрын
Thank you 😊
@Erril-1
@Erril-1 3 ай бұрын
Amazing videos :)
@deborah_kurata
@deborah_kurata 3 ай бұрын
Thanks! 😀
@patrickkabuga4945
@patrickkabuga4945 3 ай бұрын
Great video, Thanks
@deborah_kurata
@deborah_kurata 3 ай бұрын
Thanks! Glad you liked it!
@naspy971
@naspy971 3 ай бұрын
Very clear, thanks ma'am
@deborah_kurata
@deborah_kurata 3 ай бұрын
Most welcome 😊
@kashifalikhan4420
@kashifalikhan4420 3 ай бұрын
Very well explained
@deborah_kurata
@deborah_kurata 2 ай бұрын
Thank you! 😊
@kishoreandra
@kishoreandra 3 ай бұрын
wow, great tutorial .. its so clear even for a beginner to Angular like me 💯
@deborah_kurata
@deborah_kurata 3 ай бұрын
Glad to hear that! Thank you! 😊
@richarddefortune1329
@richarddefortune1329 3 ай бұрын
Brilliant! I love the "transform" part. @Input() could be use with a setter. With input signal, I was wondering whether to use a computed variable just to process the incoming data. Thanks as usually.
@deborah_kurata
@deborah_kurata 3 ай бұрын
Thank you! Yes, the transform is amazingly powerful. Regarding using a computed signal, that depends on what you are doing with that incoming data. In my example, using a computed made filtering the list easy and reactive. Any time you need to react to a change in that incoming variable, computed is very helpful. What are you doing with the incoming data? Does it need to react to changes?
@richarddefortune1329
@richarddefortune1329 3 ай бұрын
@@deborah_kurata My case was similar to what you did in video. The value being sent is an enum. Once user select a different value, some formControls will be displayed/hidden and the formGroup updated. The @Input() setter will check the incoming will call the method that contains the logic. Since there's nothing like that in input signal, that's why I was thinking about using a computed value just to react to the input signal 😇. I'm glad we've the transform method.
@juliojimenez450
@juliojimenez450 3 ай бұрын
Another great video Deborah! I am currently working on a component that contains a ‘signal input’ and from that signal I need to do a ‘Fetching Data as Side Effect’. I have only been able to achieve this by incorporating the option ‘allowSignalWrites: true’ in the effect that makes the API call, which is not recommended by angular members: ‘Using effects to synchronize data by writing to signals can lead to confusing and potentially incorrect behavior, and should be enabled only when necessary’. Some information about that would be awesome in one of your future videos! Thank you very much and keep up the good work with the channel! 😉👍
@deborah_kurata
@deborah_kurata 3 ай бұрын
Thank you! As shown in this video, you can expand the binding from two-way to the long form: property binding and event binding. Then you can fetch the data within the method bound to the event. That way you don't need to use an effect. Does that seem like it would work for you?
@shrek1478
@shrek1478 3 ай бұрын
thx
@marcelovizcarra188
@marcelovizcarra188 3 ай бұрын
Nice! It would be awesome if you can review the new output signal in another video as well 😊
@deborah_kurata
@deborah_kurata 3 ай бұрын
Coming soon! Thank you! 😊
@praku78
@praku78 2 ай бұрын
Thanks for the excellent Video, it helps to learn easily. I have a question as we started using this new signal concept, how different its from Reactive forms, can we use along with reactive forms? or should not use it?
@deborah_kurata
@deborah_kurata 2 ай бұрын
Thank you for the kind words. Signal inputs are for communication between a parent component and it's child component. They aren't useful for forms. The Angular team is working on adding signals to their forms approach, but it's not available yet.
@praku78
@praku78 2 ай бұрын
Thank you! :)
@rishukumar7586
@rishukumar7586 Ай бұрын
is there is a way to check signal is defined or not in template ?
@rkrao8582
@rkrao8582 5 күн бұрын
I have been going through your signal Videos they are really great. I have a question here so I am using Angular 18 and I have my parent component declared with every property as signal and passing one of the signal to child component as input. So in this case it should be fine right? Right now I am not seeing any errors but all the videos that I saw on signal inputs using a general value being passed from parent to child then in child using signal inputs .
@deborah_kurata
@deborah_kurata Күн бұрын
Thank you! What you are doing *sounds* right, but I'd have to see some code to be sure. If you want to create a small, focused, StackBlitz example I'd be happy to take a look. YT doesn't allow links in replies, so send me the StackBlitz using only the project name ( ~/edit/***whatever is here). That should make it past the post validation.
@igorr4682
@igorr4682 3 ай бұрын
More and more Angular reminds me of React or VUE.js
@deborah_kurata
@deborah_kurata 3 ай бұрын
Is that a good thing?
@sk8osner
@sk8osner 3 ай бұрын
I have a question, how can the computed property be used with an input that an object receives, is it necessary to change the object reference?
@deborah_kurata
@deborah_kurata 3 ай бұрын
Yes. Something like this: this.selectedVehicle.update(v => ({...v, price: v.price + (v.price * 0.2)})) I have a Stackblitz here: stackblitz.com/edit/angular-signals-v17-deborahk
@sk8osner
@sk8osner 3 ай бұрын
@@deborah_kurata just changing the object reference, is there a way to make it like this in VueJS? are the reactive type variables
@deborah_kurata
@deborah_kurata 3 ай бұрын
@@sk8osner I don't know Vue, so don't know the answer to this question.
@sk8osner
@sk8osner 3 ай бұрын
@@deborah_kurata reactive listens to the changes of any nested property of an object, without having to change its reference, thanks for your response
@TheEuphoricism
@TheEuphoricism 3 ай бұрын
doesnt all of this just feel like RXJS with handcuffs on?
@deborah_kurata
@deborah_kurata 3 ай бұрын
In what respect? signals are synchronous and focused on simplifying the template's change detection. RxJS can be synchronous or async (but most often used for async) and is focused on event-based notifications. Ben Lesh (the lead developer of RxJS) covered this well in a set of posts here: x.com/BenLesh/status/1775207971410039230
@alexpanteli3651
@alexpanteli3651 3 ай бұрын
Bootstrap in 2024?
@deborah_kurata
@deborah_kurata 3 ай бұрын
Is there something else you would suggest? I didn't want to add the "heaviness" that is Material for a sample app.
@alexpanteli3651
@alexpanteli3651 3 ай бұрын
@@deborah_kurataModern CSS comes equipped with built-in grid functionality, eliminating the necessity for additional Bootstrap classes or Tailwind as an alternative for quick prototyping. I am a huge fan of your Angular tutorials by the way.
@deborah_kurata
@deborah_kurata 3 ай бұрын
Thank you! I haven't used Tailwind. I definitely need to check out the CSS Grid.
@FUNc4l4v3r4
@FUNc4l4v3r4 3 ай бұрын
​@@deborah_kurata Tailwind is great for fast prototyping.
Declare Variables in Templates: Angular's New @let Declaration (v18.1)
11:55
Fast and Furious: New Zealand 🚗
00:29
How Ridiculous
Рет қаралды 41 МЛН
Useful gadget for styling hair 🤩💖 #gadgets #hairstyle
00:20
FLIP FLOP Hacks
Рет қаралды 9 МЛН
ПРОВЕРИЛ АРБУЗЫ #shorts
00:34
Паша Осадчий
Рет қаралды 7 МЛН
IQ Level: 10000
00:10
Younes Zarou
Рет қаралды 4,7 МЛН
Angular Signals: What? Why? and How?
27:08
Deborah Kurata
Рет қаралды 57 М.
TOP 6 Mistakes in RxJS code
18:35
Decoded Frontend
Рет қаралды 16 М.
3 ways to reduce the size of your docker images
17:20
Raghav Dua
Рет қаралды 4,2 М.
🚦Angular NgRx Signal Store: WHAT are Deep Signals??
13:53
Angular University
Рет қаралды 7 М.
Content Projection in Angular - Complete Guide (Beginners/Advanced)
26:18
Are you using Angular Signal Effects in the RIGHT way?
11:13
Transform Your Terminal: 3 Must-Have Zsh Plugins!
5:43
DevOps Toolkit
Рет қаралды 4,7 М.
Goodbye javascript (for now)
14:57
Web Dev Cody
Рет қаралды 67 М.
RxJS in Angular: Terms, Tips, and Patterns
43:01
Deborah Kurata
Рет қаралды 28 М.
The Unfixable ARM Memory Bug
28:18
ThePrimeTime
Рет қаралды 121 М.
НОВЫЕ ФЕЙК iPHONE 🤯 #iphone
0:37
ALSER kz
Рет қаралды 334 М.
Здесь упор в процессор
18:02
Рома, Просто Рома
Рет қаралды 435 М.
Как удвоить напряжение? #электроника #умножитель
1:00
Hi Dev! – Электроника
Рет қаралды 1,1 МЛН
$1 vs $100,000 Slow Motion Camera!
0:44
Hafu Go
Рет қаралды 28 МЛН