Template variables in Angular using the new @let syntax

Pubblicato il: 19 luglio 2024
sul canale di: Brian Treese
894
33

In Angular, we can now create variables for reuse right within our component templates. Now that might seem odd but it's actually pretty cool. If you're like me, you may have a hard time understanding the benefits at first so, in this video, I'll show you how to create these template variables, and then I'll show you several different possible use cases and benefits to help you better understand why you may want to use them in your projects.

------------------------------------------------------------------------------

👕 Be the coolest developer in the room with these Angular tees! (https://www.teepublic.com/user/dev-drip)

------------------------------------------------------------------------------

🔗 Demo Links:
Before (https://stackblitz.com/edit/stackblit...)
After (https://stackblitz.com/edit/stackblit...)

------------------------------------------------------------------------------
📚 Additional Resources:
The issue that started it all (https://github.com/angular/angular/is...)
Angular's local template variables documentation (https://angular.dev/guide/templates/l...)
Exploring Angular's New @let Syntax: Enhancing Template Variable Declarations (https://netbasal.com/exploring-angula...)
Introducing @let in Angular (https://blog.angular.dev/introducing-...)

------------------------------------------------------------------------------

📖 Chapters:
0:00 – Introduction
0:35 – The Anatomy of the @let Syntax
1:24 – A Simple String Variable Example
2:35 – Simplifying Async Pipe Subscriptions With @let
4:48 – Simplifying Repetitive Complex Logic with @let
6:04 – Creating a Dynamic Variable Based on Form Control Value with @let
7:16 – Signal Type Narrowing with @let
8:29 – Variables Using @let Syntax Can't be Reassigned
9:14 – Variables Using @let are Scoped
9:52 – Conclusion

------------------------------------------------------------------------------

#angular #angulartutorial #angulartraining


In questa pagina del sito puoi guardare il video online Template variables in Angular using the new @let syntax della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Brian Treese 19 luglio 2024, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 894 volte e gli è piaciuto 33 spettatori. Buona visione!