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
Watch video Template variables in Angular using the new @let syntax online without registration, duration hours minute second in high quality. This video was added by user Brian Treese 19 July 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 89 once and liked it 3 people.