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.
------------------------------------------------------------------------------
🔗 Demo Links:
- Before ([ Ссылка ])
- After ([ Ссылка ])
------------------------------------------------------------------------------
📚 Additional Resources:
- The issue that started it all ([ Ссылка ])
- Angular's local template variables documentation ([ Ссылка ])
- Exploring Angular's New @let Syntax: Enhancing Template Variable Declarations ([ Ссылка ])
- Introducing @let in Angular ([ Ссылка ])
------------------------------------------------------------------------------
📖 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
Ещё видео!