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
Смотрите видео Template variables in Angular using the new @let syntax онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Brian Treese 19 Июль 2024, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 89 раз и оно понравилось 3 людям.