Input Signals in Angular 17.1 - How To Use & Test

  Рет қаралды 20,807

Decoded Frontend

Decoded Frontend

Күн бұрын

Learn more about RxDB - bit.ly/rxdb 🚀
The introduction of Input Signals is another step towards the integration of Signals into Angular Framework Core. From this video, you will learn how to migrate your angular components to input signals smoothly and how to adjust your unit tests. Besides that, you will know how to make your inputs reactive even before Angular 17.1. If you find this video useful, you can support my channel by sharing it with your colleagues. Thank you :)
🔥 My course Conscious Angular Testing for Beginners:
bit.ly/conscious-angular-testing
🕒 Time Codes:
00:00:00 - Intro;
00:02:02 - RxDB Sponsorship;
00:03:33 - Reactive Inputs BEFORE 17.1;
00:06:07 - Introducing Signal Inputs;
00:11:18 - How To Test Signal Inputs;
00:12:24 - Final Thoughts;
00:13:47 - Outro;
🔗 Source code from the tutorial:
github.com/DMezhenskyi/angula...
💡 Short Frontend Snacks (Tips) every week here:
Twitter - / decodedfrontend
Instagram - / decodedfrontend
LinkedIn - / dmezhenskyi

Пікірлер: 92
@DecodedFrontend
@DecodedFrontend 3 ай бұрын
Learn more about RxDB - bit.ly/rxdb 🚀
@Mego4884
@Mego4884 3 ай бұрын
The database looks useful. From what I have observed the basic free functionality isn't IndexedDB database as promoted but only the in memory storage - which is not persistent. Am I getting it right or is it some misunderstanding? Thank you in advance :)
@bobkelso5681
@bobkelso5681 3 ай бұрын
@@Mego4884 RxDB has the dexie.js storage which is for free and also stores data in indexeddb
@DecodedFrontend
@DecodedFrontend 3 ай бұрын
@@Mego4884 from what I understand, the free version utilizes Dexie.js RxStorage which is a minimal wrapper around IndexedDB. The IndexedDB RxStorage is a more advanced and performant plugin that’s unfortunately, a paid option. rxdb.info/rx-storage-dexie.html
@joemtz8478
@joemtz8478 3 ай бұрын
Angular is looking better and better
@DecodedFrontend
@DecodedFrontend 3 ай бұрын
Absolutely!
@asakurayoh3909
@asakurayoh3909 27 күн бұрын
Angular is so much better when it comes to complex, large applications. Now with all these new features, it's killing it. The more I learn about these new features the more I'm in love with Angular ❤
@wissamfehmi5814
@wissamfehmi5814 3 ай бұрын
Angular Team knows who works with Angular will stick to it so they are attracting other developers since v14 by making it more similar to other frameworks but of course better 😊 As usual thank you for the fulfilled informative video
@rakhimjonrustamov5148
@rakhimjonrustamov5148 3 ай бұрын
Good point!
@gtkall
@gtkall 3 ай бұрын
This is a very welcome simplification effort from the Angular team. The code is simple and concise. I look forward to testing the update on my own!
@DecodedFrontend
@DecodedFrontend 3 ай бұрын
I am pretty sure you will like it ;)
@Aliakbaresmaeiliiii
@Aliakbaresmaeiliiii 2 ай бұрын
thank you man Im a Angualr developer over 7 year but every time i learning new stuff from you thank you very much man god bluss you
@pavlokozachuk555
@pavlokozachuk555 3 ай бұрын
What is your opinion about HttpClient and its methods? How do you see having its returned values as Observables and some Signals? What is the best way to combine values from API (Observables) with Signals in the component?
@kevinsuarezguzman302
@kevinsuarezguzman302 3 ай бұрын
I just needed the testing part, what a good explanation.
@DecodedFrontend
@DecodedFrontend 3 ай бұрын
Glad to hear that it was helpful :)
@gagiksimonyan3782
@gagiksimonyan3782 3 ай бұрын
Your videos are always useful, Dmytro) Thank you very much
@matiassantiago4205
@matiassantiago4205 3 ай бұрын
great video. thanks!
@miklosbecsei8128
@miklosbecsei8128 3 ай бұрын
Thanks for the video! Especially the testing part helped a lot! 🙂
@DecodedFrontend
@DecodedFrontend 3 ай бұрын
You are welcome! :) Glad it was helpfull ✌️
@IAmWeirdForNG
@IAmWeirdForNG 3 ай бұрын
Thank you for this simply great content 👍 Short and concise 🔥 I benefit greatly from your videos - keep it up 👣
@DecodedFrontend
@DecodedFrontend 3 ай бұрын
That's cool! Thanks for your feedback;)
@rakhimjonrustamov5148
@rakhimjonrustamov5148 3 ай бұрын
Nice recommendations at the end of the video!
@ansaganie
@ansaganie 3 ай бұрын
Your videos make me love Angular)) Thanks!
@DecodedFrontend
@DecodedFrontend 3 ай бұрын
That is so cool to hear that! Thank you for your feedback. It motivates me to make even more videos 🙌
@jakubdrewniak2668
@jakubdrewniak2668 3 ай бұрын
quality content as always. I need to get back to it when our team migrate to ng17
@DecodedFrontend
@DecodedFrontend 3 ай бұрын
I wish you a smooth migration ;)
3 ай бұрын
I hope you still have those nice plants, I miss them. 😀 Keep up the good work, I like your videos.
@DecodedFrontend
@DecodedFrontend 3 ай бұрын
Hey 👋🏻 Unfortunately, I had to give away them to other careful people ☹️
@user-dy5zv2rp9x
@user-dy5zv2rp9x 3 ай бұрын
Спасибо! Лайк не глядя
@innocentmazando3808
@innocentmazando3808 3 ай бұрын
I knew I would learn something here :). Learnt about the transformation and testing just now :)
@vOnez212
@vOnez212 3 ай бұрын
Nice! Thanks for sharing.
@maksymbykov
@maksymbykov 3 ай бұрын
Thank you 💛💙
@frbs
@frbs 3 ай бұрын
Thank you for the great content.
@DecodedFrontend
@DecodedFrontend 3 ай бұрын
Glad you like it :)
@ievgensvichkar2643
@ievgensvichkar2643 2 ай бұрын
Good content, as usual.
@MrEvilyogurt
@MrEvilyogurt 3 ай бұрын
Thanks for the guide, not a fan of the new input options but i do like that we have this to use over get/set.
@TheSysmat
@TheSysmat 3 ай бұрын
I like it with computedAsync lib
@DecodedFrontend
@DecodedFrontend 3 ай бұрын
You mean probably ngx-extention library that provides computedAsync function? :)
@TheSysmat
@TheSysmat 3 ай бұрын
@@DecodedFrontend yes
@haroldpepete
@haroldpepete 3 ай бұрын
great video, thanks, what about ngModel replacement using model(), could we achieve the same result as input signal feature?
@DecodedFrontend
@DecodedFrontend 3 ай бұрын
Hi 👋 you are welcome, Thanks for your question. I should probably clarify (and maybe create a separate dedicated video) but model() is about two-way data binding, and it is a concept that is separate from ngModel (which is directive). So ngModel won't be replaced with model(). ngModel (most probably) will be using the model() under the hood when the implementation of the template-driven forms is migrated to the signals.
@vojislavvukovic7376
@vojislavvukovic7376 3 ай бұрын
Hello Dmytro! Nice video as always. I was looking into your Angular Forms course and I am curious about one thing - do you have examples/lessons in that course with OnPush ChangeDetectionStrategy? Ty again, there is always something to learn from your videos :)
@DecodedFrontend
@DecodedFrontend 3 ай бұрын
Hi 👋🏻 thanks for your question. Actually, most of the examples in that course use the onPush change detection strategy and solve many problems that might appear in this Change Detection mode :)
@peter3818
@peter3818 3 ай бұрын
Is it possible to access injected dependencies inside the transform function? Like let's say I want to combine an input property and join it with some stateful service?
@maciek77killer
@maciek77killer 3 ай бұрын
is it correct to send observable to the child and use input signals?
@ranjan4elex
@ranjan4elex 3 ай бұрын
This is great the way you explain has always helped me. I have a question though is there a way to initialize the InputSignal in a dynamically loaded component?
@DecodedFrontend
@DecodedFrontend 3 ай бұрын
Hi! Thanks for your question. I didn’t try it on exactly this use case, but I am sure it is possible. To set the input value for dynamically created component use ComponentRef.setInput() method.
@alextimofeev8173
@alextimofeev8173 3 ай бұрын
Hello, somehow webstorm is not seeing those types on transform function so i am duplicating them, that is interesting because it is not and editor feature at all.
@mrthefankyy
@mrthefankyy 3 ай бұрын
why after transforming in the template user properties name and lastname are highlighted with red hints? concatUserNames function just add new field to existing object, so the name and lastName could not disappear 🤔
@DecodedFrontend
@DecodedFrontend 3 ай бұрын
Hey 👋😊 Thanks for your question. Actually, the concatUserNames removes those properties because I destructure the name and lastName from the original user object, so in “...user” those properties are not included anymore. Then I return an already modified object and spread “…user” which means that the new object won't get the name and lastName property.
@mrthefankyy
@mrthefankyy 3 ай бұрын
@@DecodedFrontend Right, I just noticed that desctructering. thank you for the video and explanation!
@ddgutierrez
@ddgutierrez 2 ай бұрын
Hola espero que estes muy bien! Una consulta... Cuando utilizo un getter que adentro en si mismo solicita a una señal su valor y retorna el mismo. Zonejs esta escuchando si utilizo un getter? Ejemplo get nombreTipoDeCuentaSeleccionado(): string | undefined { return this.tipoDeCuentaSeleccionadaSignal()?.toString(); } Es decir. si utilizo un getter para obtener el valor de una señal. Zonejs estaria ejecutando deteccion de cambios o el getter esta desacoplado de zonejs? Saludos!
@chinmayyogi6958
@chinmayyogi6958 3 ай бұрын
Hi , is conditional bootstraping is possible in Angular? If yes then please make a video on how to do it. Looking forward to solution. Thanks 🙏🏻
@DecodedFrontend
@DecodedFrontend 3 ай бұрын
I think I did such a video already. Please check this out - kzbin.info/www/bejne/nqObkKJ6a5V6kJYsi=hs87pitgw75slOUo
@gund_ua
@gund_ua 3 ай бұрын
Damn, Angular API more and more becomes inconsistent. Input signal is nice, but duplicating input metadata into it from a well known @Input decorator makes no sense to me. I'm still not using signals because most of my reactive code in rxjs and it just seems unnecessary to convert everything to signal while I can simply pipe values through async pipe lol. But great overview from you Dmytro, love it!
@kiambojyms2196
@kiambojyms2196 12 күн бұрын
Js frameworks are sharing syntaxes. Computed comes from vuejs.
@snivels
@snivels Ай бұрын
So what is the point of signals? Is it to replace the use of ngModel two-way bindings?
@DecodedFrontend
@DecodedFrontend Ай бұрын
Signals is the reactive primitive that has much broader area where it could be applied (not only about 2-way binding). I have a dedicated video about this topic, so you can have a look - kzbin.info/www/bejne/fnTKZKmApcuMm8ksi=AXaw0n_CUkpym6KV
@tomasroggero6559
@tomasroggero6559 2 ай бұрын
How do you test outputs?? such as model()
@TheSysmat
@TheSysmat 3 ай бұрын
But ng 17.2 model is strange for me because is bound to router
@user-xv4ib7ks7f
@user-xv4ib7ks7f 2 ай бұрын
Awesome video! Maybe you know how to set input from another component? for example protected _labelRef = contentChild(LabelComponent) this._labelRef().required.set(true); not possible, because
@user-xv4ib7ks7f
@user-xv4ib7ks7f 2 ай бұрын
Hello, the video is awesome! Maybe you know how to set data to input signal from another component? What do I mean, for example In LabelComponent I have InputSignal required: InputSignal = input(false); I have a parent component ParentComponent protected _labelRef contentChild(LabelComponent); and code this._labelRef().required.set(false); // it not possible because InputSignal don't have set method Maybe you know a variant to do that with signal, I know how to do that from the old way, but try to use the signal for new features, thanks a lot!
@kasoivasoy7808
@kasoivasoy7808 3 ай бұрын
Standalone Components + Signals almost = ReactJS&useState. Only difference is that effect() takes care of dependencies. So idk where all of these is heading to 🙃 but generally I like this approach
@RostY
@RostY 3 ай бұрын
Reactgular
@pavlokozachuk555
@pavlokozachuk555 3 ай бұрын
Google is preparing to be redeemed by Meta or vice versa
@moveonvillain1080
@moveonvillain1080 3 ай бұрын
New to Angular and I come from React. What I take away from this video is that input signals enforce unidirectional data flow similar to how React has. Only from Parent to Child and Child cannot modify unless parent provides a method for child to modify the Input coming from parent. Am I on right track here?
@fawzzhkz9023
@fawzzhkz9023 2 ай бұрын
@itslen
@itslen 2 ай бұрын
Is it possible to use input signals with the router?
@DecodedFrontend
@DecodedFrontend 2 ай бұрын
Yes! My next video is partly about that ;)
@itslen
@itslen 2 ай бұрын
@@DecodedFrontend I’ll be waiting
@dharmarajana3989
@dharmarajana3989 Ай бұрын
We can achieve the same using behavioural subjects..why do we need signals?
@DecodedFrontend
@DecodedFrontend Ай бұрын
Hey, Yes you can. However, signals are more lightweight alternative and will be deeper integrated into Angular framework in the future. All new features will be optimized and developed with Signals in mind when RxJS will become eventually optional. So the Signals are more future proof solution.
@ChipepeYamamoto
@ChipepeYamamoto Ай бұрын
I think that subjects must be subscribed and unsubscribed and are zone js dependent. Signals in other hand do not affect the whole tree of component parent down.
@amosisaila8416
@amosisaila8416 3 ай бұрын
Maybe you could have shown how to play with withComponentInputBinding() and Signal Inputs. Btw great video.
@DecodedFrontend
@DecodedFrontend 3 ай бұрын
Thank you :) It is a great idea! I'll add it to the list
@danieldanish2453
@danieldanish2453 3 ай бұрын
how to become angular dev expert ?
@tryhuma
@tryhuma 3 ай бұрын
do you live in Poland now?
@DecodedFrontend
@DecodedFrontend 3 ай бұрын
Haha, no :) Why did you think so?😄
@tryhuma
@tryhuma 3 ай бұрын
@@DecodedFrontend Many Ukrainians moved to Poland after the Russian aggression. I thought about inviting you for a beer xd
@DecodedFrontend
@DecodedFrontend 3 ай бұрын
@@tryhuma yeah, that’s an unfortunate true. However, I have been living in Austria for many years already. Anyway, I am always happy to meet in Vienna 😊
@deeperton
@deeperton 2 күн бұрын
Breaking contracts of using decorators is so React-way... don't like it. Now you need a custom IDE tuning to highlight that input function to make it noticeable in the code.
@user-ed8eb6cx7o
@user-ed8eb6cx7o 3 ай бұрын
Все добре, але чому не державною?
@DecodedFrontend
@DecodedFrontend 3 ай бұрын
Дякую за коментар. Це тому, що аудиторія в багато разів менша, ніж англомовна. Плюс, більшість українців в IT сфері чудово розуміють англійську.
@user-ed8eb6cx7o
@user-ed8eb6cx7o 3 ай бұрын
@@DecodedFrontend так і мову втратимо( ото такі патріоти(
@DecodedFrontend
@DecodedFrontend 3 ай бұрын
@@user-ed8eb6cx7o Додам трохи контексту: цей канал не хобі, а моя основна робота. Якщо я перейду на українську, то втрачу аудиторію, що, банально кажучи, призведе до закриття каналу, бо в мене не буде ресурсів на його підтримку. І в чому сенс? Якщо у вас є бажання профінансувати канал таким чином, що мені не треба буде більше турбуватися за фінансування, то я з радістю почну робити контент українською.
@user-ed8eb6cx7o
@user-ed8eb6cx7o 3 ай бұрын
@@DecodedFrontend а чому фрілансер по життю може робити контент українською і це не призводить до закриття каналу, а Ви ні? То просто у нього є бажання, а у Вас немає нажаль...але головне що флаг показали ото така підтримка української мови це такий ваш внесок і спільну боротьбу...
@D9ID9I
@D9ID9I 3 ай бұрын
Such an awful pattern. Reminds me knockoutjs times.
@DecodedFrontend
@DecodedFrontend 3 ай бұрын
Hi! Thanks for your thoughts :) By the "pattern" do you mean signals in general? If yes, I would be curious to hear why exactly? (except being similar to what KnockoutJS :) )
@D9ID9I
@D9ID9I 3 ай бұрын
@@DecodedFrontend yeah, all these computed, observables were so absolutely unfun and clunky to work with back in a days. AngularJS was like a breeze after that. And I can't believe Angular downgrades back. What I see gives me bad vibes. Like they hired some brand new and ignorant Harvard boys who think they invented proper way 🤦‍♂
First look at Signals in Angular
18:43
Decoded Frontend
Рет қаралды 43 М.
SE Radio 577: Casey Muratori on Clean Code, Horrible Performance?
1:10:41
IEEEComputerSociety
Рет қаралды 10 М.
[Vowel]물고기는 물에서 살아야 해🐟🤣Fish have to live in the water #funny
00:53
Cute Barbie gadgets 🩷💛
01:00
TheSoul Music Family
Рет қаралды 73 МЛН
Indian sharing by Secret Vlog #shorts
00:13
Secret Vlog
Рет қаралды 51 МЛН
狼来了的故事你们听过吗?#天使 #小丑 #超人不会飞
00:42
超人不会飞
Рет қаралды 55 МЛН
ANGULAR 16 SIGNALS: La guía que necesitabas 🅰️😱
27:29
Domini Code
Рет қаралды 8 М.
Signals Unleashed: The Full Guide
1:39:24
Rainer Hahnekamp
Рет қаралды 11 М.
Angular Signals. А точно ли нужен? Как работает магия сигналов
25:15
Архитектор ПО. Александр Желнин
Рет қаралды 8 М.
What’s new in Angular v18
20:08
Angular
Рет қаралды 75 М.
Understand Angular Signals in 20 Minutes
20:17
Igor Sedov
Рет қаралды 6 М.
Новый быстрый красивый Angular 17
6:23
Миша Ларченко
Рет қаралды 17 М.
Why didn't the Angular team just use RxJS instead of Signals?
8:15
Joshua Morony
Рет қаралды 84 М.
Angular Signals: What? Why? and How?
27:08
Deborah Kurata
Рет қаралды 50 М.
Angular Mistakes #6: 🛑 STOP Overusing Centralized Stores
20:20
Angular University
Рет қаралды 4,2 М.
Angular 18 is EXACTLY what we needed
9:15
Academind
Рет қаралды 42 М.
ПРОБЛЕМА МЕХАНИЧЕСКИХ КЛАВИАТУР!🤬
0:59
Корнеич
Рет қаралды 3,4 МЛН
Samsung or iPhone
0:19
rishton vines😇
Рет қаралды 8 МЛН
С Какой Высоты Разобьётся NOKIA3310 ?!😳
0:43