SWEBDEV Telegram 3056
Настройка взаимодействия компонентов в Angular

С помощью @HostBinding можно динамически изменять стили и классы хост-элемента компонента в зависимости от его состояния. Например, можно подсвечивать компонент при наведении курсора мыши или изменять его внешний вид при получении новых данных.

@Component({ ... })
export class HighlightComponent {
@HostBinding('style.backgroundColor') backgroundColor = 'transparent';
// ...
}


@HostListener позволяет компоненту реагировать на события, происходящие вне его области видимости. Это может быть полезно для создания выпадающих меню, модальных окон и других элементов интерфейса, которые должны взаимодействовать с остальной частью страницы.

@Component({ ... })
export class DropdownComponent {
@HostListener('document:click', ['$event'])
onClick(event: MouseEvent) { /* ... */ }
}


👉 @sWebDev
4👍2



tgoop.com/sWebDev/3056
Create:
Last Update:

Настройка взаимодействия компонентов в Angular

С помощью @HostBinding можно динамически изменять стили и классы хост-элемента компонента в зависимости от его состояния. Например, можно подсвечивать компонент при наведении курсора мыши или изменять его внешний вид при получении новых данных.

@Component({ ... })
export class HighlightComponent {
@HostBinding('style.backgroundColor') backgroundColor = 'transparent';
// ...
}


@HostListener позволяет компоненту реагировать на события, происходящие вне его области видимости. Это может быть полезно для создания выпадающих меню, модальных окон и других элементов интерфейса, которые должны взаимодействовать с остальной частью страницы.

@Component({ ... })
export class DropdownComponent {
@HostListener('document:click', ['$event'])
onClick(event: MouseEvent) { /* ... */ }
}


👉 @sWebDev

BY Frontender Libs - обзор библиотек JS / CSS




Share with your friend now:
tgoop.com/sWebDev/3056

View MORE
Open in Telegram


Telegram News

Date: |

Hui said the messages, which included urging the disruption of airport operations, were attempts to incite followers to make use of poisonous, corrosive or flammable substances to vandalize police vehicles, and also called on others to make weapons to harm police. The creator of the channel becomes its administrator by default. If you need help managing your channel, you can add more administrators from your subscriber base. You can provide each admin with limited or full rights to manage the channel. For example, you can allow an administrator to publish and edit content while withholding the right to add new subscribers. A Telegram channel is used for various purposes, from sharing helpful content to implementing a business strategy. In addition, you can use your channel to build and improve your company image, boost your sales, make profits, enhance customer loyalty, and more. Image: Telegram. Don’t publish new content at nighttime. Since not all users disable notifications for the night, you risk inadvertently disturbing them.
from us


Telegram Frontender Libs - обзор библиотек JS / CSS
FROM American