Angular CDK: Auto-resizing textareas!

Опубликовано: 28 Июнь 2024
на канале: Brian Treese
573
29

By default, an HTML textarea control doesn’t expand or contract as content is added and removed. Sometimes this is ok, but often it would be better if we did have some control where we could allow the height to resize automatically, to better fit the content. We’ll this is possible and, in fact, it’s really easy to do in Angular when using the CDK. In this video I’ll show you just how easy it is. Alright, let’s get to it!

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

👕 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:
Angular CDK Textarea Autosize Documentation (https://material.angular.io/cdk/text-...)

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

📖 Chapters:
0:00 – Introduction
0:38 – The Demo Application
1:15 – Installing the Angular CDK
1:37 – How to Auto-Resize textareas in Angular Using the cdkTextareaAutosize Directive
3:25 – Include Angular CDK Auto-size Styles for Proper textarea Height Calculation
4:58 – Add Min and Max row Counts to Control Min and Max textarea Heights
6:07 – Conclusion

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

#angular #angulartutorial #cdk


Смотрите видео Angular CDK: Auto-resizing textareas! онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Brian Treese 28 Июнь 2024, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 57 раз и оно понравилось 2 людям.