Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

Selecting child elements, components, and directives... the Angular way

Автор: Brian Treese

Загружено: 2023-09-22

Просмотров: 838

Описание:

In Angular, things are done differently. For example, when we need to access an HTML element programmatically from JavaScript, we shouldn’t use DOM selection tools like document.queryselector(). Instead, we should use the Angular @ViewChild decorator and a template reference variable. This is because of the way that Angular’s change detection works. And, if we don’t use the tools that Angular provides, it’s possible that things won’t work as expected. In this video I’m going to show you how to do this.

First we’ll access a child HTML element from our component TypeScript with the @ViewChild decorator and a template reference variable. Then, we’ll look at how we can access a child component or directive using the same @ViewChild decorator. After that we’ll learn how to access a nested child component or directive within projected content using Angular's @ContentChild decorator this time. Alright, let’s get to it.

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

🔗 Demo Links:
@ViewChild and HTML Element: https://stackblitz.com/edit/stackblit...
@ViewChild and Component: https://stackblitz.com/edit/stackblit...
@ContentChild and Component: https://stackblitz.com/edit/stackblit...

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

📖 Chapters:
0:00 – Introduction
1:04 – Angular's View vs. Content Concept
1:31 – Accessing an HTML Element with @ViewChild and a Template Reference Variable
3:49 – Accessing a Child Component in the Template with @ViewChild
5:35 – Accessing a Child Component within Projected Content with @ContentChild

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

#angular #angulartutorial #angularcourse

Selecting child elements, components, and directives... the Angular way

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

Mastering event listening in Angular: 4 essential techniques

Mastering event listening in Angular: 4 essential techniques

Angular ARIA уже здесь: что он делает, зачем он нужен и когда его использовать.

Angular ARIA уже здесь: что он делает, зачем он нужен и когда его использовать.

Уязвимости в современных JavaScript-фреймворках на примере React, Vue и Angular / А. Важинская

Уязвимости в современных JavaScript-фреймворках на примере React, Vue и Angular / А. Важинская

Signal queries: Angular viewChild() and contentChild() functions

Signal queries: Angular viewChild() and contentChild() functions

From plain textarea to AI suggestions with Angular Signal Forms

From plain textarea to AI suggestions with Angular Signal Forms

Google Antigravity — “ферарі” серед IDE з ШІ-агентом

Google Antigravity — “ферарі” серед IDE з ШІ-агентом

Angular ElementRef | Angular ViewChild и ViewChildren — правильный доступ к элементам

Angular ElementRef | Angular ViewChild и ViewChildren — правильный доступ к элементам

Teleport a component in Angular (and keep its state)

Teleport a component in Angular (and keep its state)

Dynamic Component in Angular (2024)

Dynamic Component in Angular (2024)

В формах сигналов Angular появились автоматические классы состояния (вот как их использовать).

В формах сигналов Angular появились автоматические классы состояния (вот как их использовать).

Modern Angular animations: ditch the DSL, keep the power

Modern Angular animations: ditch the DSL, keep the power

The Windows 11 Disaster That's Killing Microsoft

The Windows 11 Disaster That's Killing Microsoft

Zed IDE: Полный обзор спустя год | Личный опыт разработки на ней

Zed IDE: Полный обзор спустя год | Личный опыт разработки на ней

Typst: Современная замена Word и LaTeX, которую ждали 40 лет

Typst: Современная замена Word и LaTeX, которую ждали 40 лет

Она мастер спорта по боксу! Как тренируются лучшие девушки боксеры

Она мастер спорта по боксу! Как тренируются лучшие девушки боксеры

Resolver Guard in Angular Router (2021)

Resolver Guard in Angular Router (2021)

Отправляйте формы современным способом в Angular Signal Forms.

Отправляйте формы современным способом в Angular Signal Forms.

SSG против SSR: объяснение за 10 минут (для начинающих)

SSG против SSR: объяснение за 10 минут (для начинающих)

Я ненавижу длинные цепочки If-Elif: этот шаблон проектирования решил эту проблему раз и навсегда

Я ненавижу длинные цепочки If-Elif: этот шаблон проектирования решил эту проблему раз и навсегда

Бизнес-логика в dataclass, pydantic, attrs-классах или в обычных классах? ООП в Python

Бизнес-логика в dataclass, pydantic, attrs-классах или в обычных классах? ООП в Python

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: infodtube@gmail.com