Build Generalized DRY Angular Code with Generics

  Рет қаралды 12,308

Deborah Kurata

Deborah Kurata

Күн бұрын

Пікірлер: 149
@roman6504
@roman6504 5 ай бұрын
I consider myself very lucky that I accidentally saw it in the recommendations for your channel, Deborah. Thank you very much
@deborah_kurata
@deborah_kurata 5 ай бұрын
I am too! Thanks for watching!
@gasparsantillan5357
@gasparsantillan5357 5 ай бұрын
Signals + Typescript tricks? We needed this!!
@deborah_kurata
@deborah_kurata 5 ай бұрын
Glad to hear that! Thanks!
@kettenbach
@kettenbach 6 ай бұрын
Always love your content Deborah. Been a fan for many many years. You're my goto source for the latest Angular features. Things are clear and concise and easy to digest. Thank you! 🙏
@richarddefortune1329
@richarddefortune1329 6 ай бұрын
I learned angular by watching Deborah's courses on Pluralsight. She's the best.
@kettenbach
@kettenbach 6 ай бұрын
@@richarddefortune1329 same. Learned Rxjs too
@deborah_kurata
@deborah_kurata 6 ай бұрын
Wow, thank you! 😊
@yonester7
@yonester7 2 ай бұрын
This is one of those things I've seen around a bunch but never really understood thoroughly enough to use. Your explanation cleared this up perfectly for me. Thank you so much for all these videos, they're immensely helpful. I think I'll make this required training for my team :)
@deborah_kurata
@deborah_kurata 2 ай бұрын
That's wonderful to hear. Thank you!
@dinysanchez
@dinysanchez 6 ай бұрын
Please continue creating this amazing content! It's hard to find advanced Angular content elsewhere. As always, Thank you!
@deborah_kurata
@deborah_kurata 6 ай бұрын
Glad to hear it's useful. Thank you!
@theintjengineer
@theintjengineer 4 ай бұрын
Came for Angular and stayed for the TypeScript gold lessons/hints🤷🏾‍♂️. Thank you🫶. Love you❤.
@deborah_kurata
@deborah_kurata 4 ай бұрын
So great to hear that the videos are useful! Thank you!
@RsPippen
@RsPippen 6 ай бұрын
Amazing as always! I would love to see a video on unit testing best practices in Angular when using a declarative approach. I always get stuck and usually have to revert my code back to an imperative style
@deborah_kurata
@deborah_kurata 6 ай бұрын
Thank you! Yes! I had been putting off doing any testing content because the testing libraries Angular supports has changed (Karma, Jasmine, Jest, ngMocks, cypress, Playwright. But maybe it's time to get back to that! In the mean time, this could be helpful: angular.dev/guide/testing/services
@ajaykarwal
@ajaykarwal 2 ай бұрын
Brain explode gif is about right. Might have to watch this again an delve deeper but that was very informative and something worth trying to grasp
@deborah_kurata
@deborah_kurata 2 ай бұрын
Glad to hear that it was interesting and informative. All the best!
@HoNow222
@HoNow222 6 ай бұрын
PLEASE more videos about Generics and Signals! 😍
@deborah_kurata
@deborah_kurata 6 ай бұрын
Great idea! Thanks!
@julienr8114
@julienr8114 5 ай бұрын
Best KZbin Content for Angular. Thks a lot Deborah.
@deborah_kurata
@deborah_kurata 5 ай бұрын
Wow, thank you! 😊
@joeyvico
@joeyvico 5 ай бұрын
Love these advanced / expert tutorials on both Angular and Typescript. Thanks Deborah
@deborah_kurata
@deborah_kurata 5 ай бұрын
Glad it was helpful! Thanks!
@MrPankoPanko
@MrPankoPanko 5 ай бұрын
I am impressed. Really good quality video! Looking for more angular tutorials!
@deborah_kurata
@deborah_kurata 5 ай бұрын
Thank you so much! 😊 You can find my Angular playlists here: kzbin.info/aero/PLErOmyzRKOCrzJ9zUEGgC1zVzVGt3hMmV And here: kzbin.info/aero/PLErOmyzRKOCr07Kcnx75Aqh6PWSbIokPB
@ArchitecturalAesthetics2046
@ArchitecturalAesthetics2046 4 ай бұрын
so informative. never even heard of `extends keyof` operator. thank you Deborah.
@deborah_kurata
@deborah_kurata 3 ай бұрын
So glad to hear it was useful! Thank you for watching!
@selektahx
@selektahx 5 ай бұрын
Your content is amazing. Please continue to share your knowledge. You are great!
@deborah_kurata
@deborah_kurata 5 ай бұрын
Thank you so much!
@valikonen
@valikonen 6 ай бұрын
Fantastic example! Let me give you an example: I have a http req. and the response from the backend it's very different from what I must use in front and I created two interfaces, one from the response from the backend and one for UI after I map the values. Can I use a generic in that case? One option it's to use a map operator in pipe...Thank you for your great content!
@deborah_kurata
@deborah_kurata 6 ай бұрын
Thank you! This is how I've done it (as you said, with 'map'), where ProductFromAPI is one interface and Product is the other: productsFromAPI$ = this.http.get('api/productsFromAPI') .pipe( map(products => products.map(product => ({ id: product.p_id, productName: product.p_nam, productCode: product.p_cd, description: product.p_des, categoryId: product.p_c_fk_id, price: product.p_p * 1.5 }) as Product)), catchError(this.handleError) ); My first thought is that you wouldn't be able to do something like this with generics because each object would require specific mapping. Unless the mappings for your different object types are very generalized, generics won't be able to help much.
@stevewitman
@stevewitman 6 ай бұрын
AWESOME video Deborah! My knowledge and ability to use generics is only that I know they exist. I have this video on my list to revisit this weekend, to type out and explain out loud several times until I can reproduce this all on my own. Thanks!
@deborah_kurata
@deborah_kurata 6 ай бұрын
Thank you! Let me know if you have any questions. Have fun! (I have the link to my stackblitz in the video notes if you want the code I used.)
@jackiecooper9439
@jackiecooper9439 5 ай бұрын
Deborah , you are the best! No comparison. Waiting for your Angular 18 Getting Started course🤗
@deborah_kurata
@deborah_kurata 5 ай бұрын
Thank you so much!
@MarcoPinheiro
@MarcoPinheiro 6 ай бұрын
This is pure gold Deborah, thanks for this awesome resource!!
@deborah_kurata
@deborah_kurata 6 ай бұрын
Great to hear. Thank you!
@lacerdae
@lacerdae 5 ай бұрын
Ma'am, you are the best! So much I have learned with your Angular content. Keep it up
@deborah_kurata
@deborah_kurata 5 ай бұрын
That's great to hear. Thank you! 😊
@denberghvanmartijn
@denberghvanmartijn 5 ай бұрын
This is awesome! would also love a video about best practices in terms of project and folder structure.
@deborah_kurata
@deborah_kurata 5 ай бұрын
Thanks! Great idea!
@janis666
@janis666 6 ай бұрын
very informative! always enjoying to watch your tutorials. thanks!
@deborah_kurata
@deborah_kurata 6 ай бұрын
That's kind of you to say. Thank you!
@ranjan4elex
@ranjan4elex 6 ай бұрын
Awesome content as always.. love the way you explain complex concepts in very easy to understand way, Thank you!!!
@deborah_kurata
@deborah_kurata 6 ай бұрын
Thank you so much for the kind words! 😊
@osamaabozahra
@osamaabozahra 5 ай бұрын
Thank you for the fantastic video, Deborah. I was opening the video saying to myself what is going to be new in generics, I already know them 😅 Then I learnt "K extends keyof T" and it was mind blowing moment.
@deborah_kurata
@deborah_kurata 5 ай бұрын
Yay! It's so great to hear that the video was useful! Thanks!
@nathanalberg
@nathanalberg Ай бұрын
my only advice would be at around 3:30... I would have explained more in depth how the relationships between the generics and the incoming arguments work. ie... If you dont pass in a type when calling logSignal.. the type will be inferred by the argument that was passed in etc etc. For example.. calling `logSignal(this.mySignal) would error.. however `logSignal(this.mySignal)` would not.
@rolygonz1964
@rolygonz1964 5 ай бұрын
You are the best . Please continue creating this amazing content. Thank you !
@deborah_kurata
@deborah_kurata 5 ай бұрын
That's kind of you to say. Thank you!
@_perfectCTO
@_perfectCTO 6 ай бұрын
The community owes you big time, Deborah. I hope you never lack the energy to keep going for a long, long time. Just curious, how do you dive into and explore these sometimes new other times advanced concepts? How much trial and error does it involve, or do you have specific places to look beyond documentation?
@deborah_kurata
@deborah_kurata 6 ай бұрын
That's very kind of you to say. I came from Visual Basic -> C# -> JavaScript -> TypeScript, so many of these concepts (like Generics) I already knew from my VB.NET/C# days. I do spent quite a bit of time experimenting, to see how to actually *use* the techniques in an Angular app. Having a specific purpose makes it easier to explain and apply that technique. Then a good amount of googling to ensure I haven't missed or misunderstood something. 😊
@rippan23452
@rippan23452 6 ай бұрын
Great video as always! Very elegant, I wonder if it’s possible to make the generic update function to set multiple props?
@deborah_kurata
@deborah_kurata 6 ай бұрын
Thank you! TypeScript has variadic tuple types that support a generic spread operator. More information here: www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#variadic-tuple-types. You could possibly use something like that to take in any number of properties/values. (I haven't had the need for something like this, so don't have an example for you. Maybe a future video? 😄) Or maybe more straightforward, use a key/value pair to pass in property/values as an array?
@07bakabaka
@07bakabaka 2 ай бұрын
Amazing , hero of angular beginners!!!
@deborah_kurata
@deborah_kurata 2 ай бұрын
Thank you!
@pazzuto
@pazzuto 5 ай бұрын
Great content! Generics seem easy at first, but can get pretty crazy quick. I remember when they were first introduced in C# back in early 2000 (I think) - It was an interesting concept to grasp, but I can't imagine coding without it now. When it comes to TypeScrpt, it kinda feels the same as back ~2000, the syntax can really give you a headache, but it's definitely worth using it. Thank you for a great explanation!
@deborah_kurata
@deborah_kurata 5 ай бұрын
Thank you! And yep! This topic is definitely more straightforward for those coming to Angular with a .NET background! For many that come to Angular from HTML or vanilla JavaScript, generics are completely new. I'm sure it must be a big mental shift to "think generically". 😊
@enverusta7811
@enverusta7811 6 ай бұрын
Awesome content! I was just tackling these kind of things on my projects. Awesome coinsidence.
@deborah_kurata
@deborah_kurata 6 ай бұрын
Perfect! Great to hear the info will be useful! Thanks!
@pavelernestonavarroguerrer7871
@pavelernestonavarroguerrer7871 5 күн бұрын
Incredible useful and interesting video, thank you so much.
@deborah_kurata
@deborah_kurata 5 күн бұрын
I'm glad you found it useful. Thank you! 😊
@EnriqueMartinezInter
@EnriqueMartinezInter 3 ай бұрын
This content is simply...AMAZING!!
@deborah_kurata
@deborah_kurata 2 ай бұрын
Thank you so much!
@BJAnderson
@BJAnderson 6 ай бұрын
Amazing explanation. I understand generics, but wanted to see your take on them. Went from too easy to brain melting in 15 minutes, and all while keeping it clear and understandable. Great job :)
@deborah_kurata
@deborah_kurata 6 ай бұрын
Now I have that image from "Raiders of the Lost Ark" in my head. LOL! Thank you so much for the kind words! 😊
@en818
@en818 5 ай бұрын
You explained things so well 🙌
@deborah_kurata
@deborah_kurata 5 ай бұрын
Thank you! 😊
@mohitpandey2388
@mohitpandey2388 5 ай бұрын
What an amazing & knowledgeable video. Keep up the good work❤️
@deborah_kurata
@deborah_kurata 5 ай бұрын
Thank you so much!
@vd2828
@vd2828 6 ай бұрын
Amazing video, Thank you so much. Could you please consider about a video demonstrating how to generically pass input values from a parent component to child component?
@deborah_kurata
@deborah_kurata 6 ай бұрын
Thanks! Could you elaborate on your suggestion? What's the scenario? The new input doesn't require a type, so it's already somewhat generalized: employee = input(); The parent component can pass anything. The child can *require* a type using something like this: employee = input(); And you can do something like this: export class FilterComponent { someArray = input.required(); } Is that what you are picturing?
@vd2828
@vd2828 5 ай бұрын
Hi @@deborah_kurata, Thank you for your reply. export class FilterComponent { someArray = input.required(); } The class component with the type was what I looking for. We don't need to declare the type of any for the input variable, then we can call the generic function. This is great.
@EmilioDegiovanni
@EmilioDegiovanni 6 ай бұрын
Excellent video Deborah!
@deborah_kurata
@deborah_kurata 6 ай бұрын
Thank you! 😊
@richarddefortune1329
@richarddefortune1329 6 ай бұрын
Thanks so much for this video. You present typescript better than their own website.
@deborah_kurata
@deborah_kurata 6 ай бұрын
Thanks! 😊
@ChessPuzzlesVideo
@ChessPuzzlesVideo 6 ай бұрын
Another great content in a simple language 👍. Can you also make video on SOLID design principle (in angular)
@deborah_kurata
@deborah_kurata 6 ай бұрын
Thank you! And great idea! I'll add it to the list. 😊
@TheAdamwest29
@TheAdamwest29 29 күн бұрын
Nice! Is there a library that implements this?
@deborah_kurata
@deborah_kurata 28 күн бұрын
Thanks! I would guess that many code libraries leverage generics using techniques like this. But I don't know of one in particular.
@DraaElMizan
@DraaElMizan 6 ай бұрын
Amazing, thanks Deborah.
@deborah_kurata
@deborah_kurata 6 ай бұрын
Thanks for listening! 😊
@lijiklevi827
@lijiklevi827 3 ай бұрын
Great content & explanation, Thank you❤
@deborah_kurata
@deborah_kurata 3 ай бұрын
Thanks! 😊
@PanDaNWS
@PanDaNWS 6 ай бұрын
Love your video, it helps me improve my coding better.
@deborah_kurata
@deborah_kurata 6 ай бұрын
Great to hear! Thank you!
@joepersonbelgica3980
@joepersonbelgica3980 5 ай бұрын
Very helpful. Thanks
@deborah_kurata
@deborah_kurata 5 ай бұрын
Glad it was helpful! Thank you! 😊
@cathyf5449
@cathyf5449 6 ай бұрын
Awesome video as always. Thanks!😄
@deborah_kurata
@deborah_kurata 6 ай бұрын
Thank you! 😊
@KiffinGish
@KiffinGish 6 ай бұрын
Nicely done again!
@deborah_kurata
@deborah_kurata 6 ай бұрын
Thank you!
@AlexLikeGolf
@AlexLikeGolf 6 ай бұрын
You just taught Typescript Generic in 15 minutes. Can you create a deep-dive Angular Getting Started with your narration style? I enjoyed your Pluralsight videos, but I no longer have access to them.
@deborah_kurata
@deborah_kurata 6 ай бұрын
Thank you for watching! I have been considering doing some type of "Getting Started" content here. But I haven't quite figured out what that would look like in a KZbin environment. Maybe a set of build-along videos? Thanks for the suggestion.
@houseofgames6099
@houseofgames6099 6 ай бұрын
Hello I have completed your couple of courses on plurasight.. really loved it.. I mean I was lucky to find you as an instructor for Angular courses.. Could you please do a course on Javascript please. not basic Js language but more of a little above begineer to super Advanced concepts and beauty of js language. So if anyone ask me any advanced/tricky concepts of js I should be able to solve it. More like book series "You don't know Js".. Please!!!
@deborah_kurata
@deborah_kurata 6 ай бұрын
Thank you so much! 😊 I did a JavaScript course here on KZbin. Here's the playlist: kzbin.info/aero/PLErOmyzRKOCpmitTOazq3_p74Y-yTQB6A I also have a general "JavaScript Topics" playlist you can find here: kzbin.info/aero/PLErOmyzRKOCqpYd2OvTxg74DUj9McAjbL This playlist includes a video on immutability and several lesser known array methods. You could check out those videos and see if I cover anything more "advanced beginner" that would be useful for you. Are there any other specific JS topics you'd be interested in?
@araujomartin
@araujomartin 5 ай бұрын
Very usefull! Excellent video
@deborah_kurata
@deborah_kurata 5 ай бұрын
Thank you so much!
@nope7843
@nope7843 6 ай бұрын
Awesome as always thanks for sharing it with us 🙏
@deborah_kurata
@deborah_kurata 6 ай бұрын
Great to hear. Thank you!
@positivenegativ
@positivenegativ 6 ай бұрын
I simply cannot thank you enough
@deborah_kurata
@deborah_kurata 6 ай бұрын
So happy to hear that it was useful! Thank you!
@dougl765
@dougl765 5 ай бұрын
You're the best! Thank-you so much for you skills!
@deborah_kurata
@deborah_kurata 5 ай бұрын
That is kind of you. Thanks!
@andsons159
@andsons159 6 ай бұрын
My all time teacher,
@deborah_kurata
@deborah_kurata 6 ай бұрын
That is kind of you to say. Thank you!
@daringuL
@daringuL 2 ай бұрын
Very nice tutorial❤
@deborah_kurata
@deborah_kurata 2 ай бұрын
Thank you! 😊
@codewithmenow1412
@codewithmenow1412 5 ай бұрын
WOW Amazing as usual 🤩
@deborah_kurata
@deborah_kurata 5 ай бұрын
Thank you so much 😀
@rkumar.lnct24
@rkumar.lnct24 6 ай бұрын
Awesome explanation 🎉
@deborah_kurata
@deborah_kurata 6 ай бұрын
Thank you! 😊
@matheusluz2318
@matheusluz2318 6 ай бұрын
hi there! love your videos! if you can, please make a sequel about subscribe vs toSignal and async pipe (as mentioned in the video: Use takeUntilDestroyed to Unsubscribe from Angular's Observables 10:17)
@deborah_kurata
@deborah_kurata 6 ай бұрын
Thank you so much! Great suggestion! I'll add it to my list.
@Nabulio85
@Nabulio85 6 ай бұрын
❤ for you ❤️ for your content 😊 Thank you again.
@deborah_kurata
@deborah_kurata 5 ай бұрын
That is very kind. Thank you! 🧡
@syedmohammadnejat
@syedmohammadnejat 6 ай бұрын
As Always Perfect Video :P
@deborah_kurata
@deborah_kurata 6 ай бұрын
Thank you so much!
@Ali-cx7sy
@Ali-cx7sy 5 ай бұрын
Please about SOLID in Angular
@zaferdemir4680
@zaferdemir4680 6 ай бұрын
Super. Thanks
@deborah_kurata
@deborah_kurata 6 ай бұрын
😊
@richardbraul1702
@richardbraul1702 Ай бұрын
This is wonderful 😮😮😮
@deborah_kurata
@deborah_kurata Ай бұрын
Thank you! 🙏🏼
@rowilduazo1367
@rowilduazo1367 Ай бұрын
Amazing! 😯❤
@deborah_kurata
@deborah_kurata Ай бұрын
Thank you! 😊
@epoppy
@epoppy 6 ай бұрын
this is awesome 🎉
@deborah_kurata
@deborah_kurata 6 ай бұрын
Thanks! 😊
@DejanFilipov-gv8qz
@DejanFilipov-gv8qz 5 ай бұрын
Teacher 💜
@hamadykais9318
@hamadykais9318 5 ай бұрын
Powerful!!
@deborah_kurata
@deborah_kurata 5 ай бұрын
Yep! Thanks!
@martinflores9611
@martinflores9611 3 ай бұрын
wow very good video
@deborah_kurata
@deborah_kurata 3 ай бұрын
Thank you 🤗
@alexandrechmakotine8712
@alexandrechmakotine8712 Ай бұрын
excellent !
@deborah_kurata
@deborah_kurata Ай бұрын
Thank you! 😊
@mibi2007
@mibi2007 5 ай бұрын
thanks 😊
@deborah_kurata
@deborah_kurata 5 ай бұрын
Welcome 😊
@Ali-cx7sy
@Ali-cx7sy 5 ай бұрын
Bilbo, Frodo, Drogo!
@kyawswarthwin6451
@kyawswarthwin6451 3 ай бұрын
🎉🎉🎉
@deborah_kurata
@deborah_kurata 2 ай бұрын
🙏🏼🙏🏼😊
@miloszivkovic6607
@miloszivkovic6607 6 ай бұрын
I love you.
@deborah_kurata
@deborah_kurata 6 ай бұрын
I assume you mean you love my content. 😊 Thank you!
@miloszivkovic6607
@miloszivkovic6607 6 ай бұрын
@@deborah_kurata Content is amazing. And the content creator as you is a good human being who is spreading his knowledge to society... If 10M+ people can express love to music, movie stars and other entertainment content, why shouldn't I do the same for someone like yourself? Nothing personal, but this is entertainment for me, so i wanted to express it, exactly like I did, because you are a Rock Star! ( with a pretty nice and calming voice :D ). Joke aside. As a human to another human, thank you! Keep up with good and honorable work, we need you!
@deborah_kurata
@deborah_kurata 6 ай бұрын
That is so very kind of you to say! Thank you! 😊💖
@dragonstore6308
@dragonstore6308 3 ай бұрын
To be honest, I think you're forcing the principles and making the code harder to read.
@deborah_kurata
@deborah_kurata 2 ай бұрын
These techniques are not for everyone and not for every project. They are definitely aimed at larger teams that are trying to build generic reusable code for use in multiple parts of an application, or even multiple applications. It's way overkill for straightforward, standard applications.
@bibbychung
@bibbychung 6 ай бұрын
It's so hard ^^|||..
@deborah_kurata
@deborah_kurata 6 ай бұрын
Is there anything I can clarify?
Currying for More Generalized Angular Code
12:41
Deborah Kurata
Рет қаралды 6 М.
A Redux-like Pattern for Managing State with Angular signals
17:51
Deborah Kurata
Рет қаралды 14 М.
УЛИЧНЫЕ МУЗЫКАНТЫ В СОЧИ 🤘🏻
0:33
РОК ЗАВОД
Рет қаралды 7 МЛН
Advanced Golang: Generics Explained
13:37
Code With Ryan
Рет қаралды 70 М.
`const` was a mistake
31:50
Theo - t3․gg
Рет қаралды 140 М.
Angular Signals: What? Why? and How?
27:08
Deborah Kurata
Рет қаралды 70 М.
Zoneless Angular Applications in V18
14:00
Deborah Kurata
Рет қаралды 20 М.
How Did I Not Know This TypeScript Trick Earlier??!
9:11
Josh tried coding
Рет қаралды 218 М.
How Angular Signals and RxJS Work Together
16:15
Deborah Kurata
Рет қаралды 31 М.
ngTemplateOutlet is WAY more useful than I realised
16:36
Joshua Morony
Рет қаралды 77 М.
HTMX Sucks
25:16
Theo - t3․gg
Рет қаралды 131 М.
BIP HOUSE  .бип хаус 🥰🏡  #shorts
0:13
bip_house
Рет қаралды 1,2 МЛН
#trending #foryou #challenge #fyp #viral #short #tiktok #vs
0:15
Misiсatсh
Рет қаралды 2,4 МЛН
Это лютый угар 🤣 | приколы Арсен Симонян
0:14
Арсен Симонян
Рет қаралды 294 М.
Абзал неге келді? 4.10.22
3:53
QosLike fan club
Рет қаралды 31 М.
Лайфхак: Легально делать деньги
0:43