Template variables in Angular using the new @let syntax

Veröffentlicht am: 19 Juli 2024
auf dem Kanal: 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


Auf dieser Seite können Sie das Online-Video Template variables in Angular using the new @let syntax mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Brian Treese 19 Juli 2024 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 894 Mal angesehen und es wurde von 33 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!