- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
How to use the Angular CDK Viewport Ruler for responsive apps
Sometimes, in an Angular app we need to trigger something when the viewport gets resized. Take an example of an app where we can open a responsive menu panel that lays on top of everything else. We may want to automatically close the menu when the browser is resized. How can we do this? Well, maybe you have some ideas, but with the Angular CDK, this is pretty easy. We can use the Viewport Ruler. It’s a utility that deals with several aspects of, you guessed it, the viewport. In this video I’m going to show you how to use it and the features it provides. Alright, let’s get to it.
------------------------------------------------------------------------------
🔗 Demo Link:
https://stackblitz.com/edit/stackblitz-starters-kvsh1c?file=src%2Fmain.ts
------------------------------------------------------------------------------
📖 Chapters:
0:00 - Introduction
1:43 - Setting up the the CDK ViewportRuler
2:15 - Subscribing to the CDK ViewportRuler change event
3:00 - Using NgZone to run the CDK ViewportRuler change event within Angular’s change detection
3:49 - Using the CDK ViewportRuler to get the viewport rect object
4:16 - Using the CDK ViewportRuler to get the current viewport scroll position
4:39 - Using the CDK ViewportRuler to get the viewport size
------------------------------------------------------------------------------
#angular #cdk #responsive
Видео How to use the Angular CDK Viewport Ruler for responsive apps канала Brian Treese
------------------------------------------------------------------------------
🔗 Demo Link:
https://stackblitz.com/edit/stackblitz-starters-kvsh1c?file=src%2Fmain.ts
------------------------------------------------------------------------------
📖 Chapters:
0:00 - Introduction
1:43 - Setting up the the CDK ViewportRuler
2:15 - Subscribing to the CDK ViewportRuler change event
3:00 - Using NgZone to run the CDK ViewportRuler change event within Angular’s change detection
3:49 - Using the CDK ViewportRuler to get the viewport rect object
4:16 - Using the CDK ViewportRuler to get the current viewport scroll position
4:39 - Using the CDK ViewportRuler to get the viewport size
------------------------------------------------------------------------------
#angular #cdk #responsive
Видео How to use the Angular CDK Viewport Ruler for responsive apps канала Brian Treese
angular angular tutorial angular training frontend web development javascript typescript angular cdk cdk layout angular cdk viewport ruler cdk viewport ruler viewport ruler responsive media query tutorial tutorials coding coding tutorials angular tutorials web apps programming ui ux screencast learn angular angular lesson angularjs angular 6 angular 9 angular 17 angular 18 angular tutorial for beginners angular 18 tutorial
Комментарии отсутствуют
Информация о видео
17 ноября 2023 г. 16:00:09
00:05:20
Другие видео канала




















