Компонент Clamped Text помогает аккуратно показать длинный текст. В свернутом виде он оставляет только заданное число строк, а при разворачивании показывает весь текст.

In a distributed denial-of-service attack (DDoS attack), the incoming traffic flooding the victim originates from many different sources. More sophisticated strategies are required to mitigate this type of attack; simply attempting to block a single source is insufficient as there are multiple sources. A DoS or DDoS attack is analogous to a group of people crowding the entry door of a shop, making it hard for legitimate customers to enter, thus disrupting trade and losing the business money. Criminal perpetrators of DoS attacks often target sites or services hosted on high-profile web servers such as banks or credit card payment gateways. Revenge and blackmail, as well as hacktivism, can motivate these attacks.

По умолчанию текст обрезается после 5 строк. Атрибут rows задает, сколько строк показывать в свернутом виде:

<kbq-clamped-text [rows]="3">
    In a distributed denial-of-service attack (DDoS attack), the incoming traffic flooding the victim originates from
    many different sources. More sophisticated strategies are required to mitigate this type of attack; simply
    attempting to block a single source is insufficient as there are multiple sources.
</kbq-clamped-text>

Если скрытая часть содержит всего одну строку, компонент показывает её сразу. Кнопка «Развернуть» не появляется, потому что текст уже занимает ту же высоту, что и свернутая часть с кнопкой.

Свёрнутым состоянием можно управлять снаружи: родитель задаёт его сам, а когда пользователь нажимает переключатель, получает новое значение.

In a distributed denial-of-service attack (DDoS attack), the incoming traffic flooding the victim originates from many different sources. More sophisticated strategies are required to mitigate this type of attack; simply attempting to block a single source is insufficient as there are multiple sources. A DoS or DDoS attack is analogous to a group of people crowding the entry door of a shop, making it hard for legitimate customers to enter, thus disrupting trade and losing the business money. Criminal perpetrators of DoS attacks often target sites or services hosted on high-profile web servers such as banks or credit card payment gateways. Revenge and blackmail, as well as hacktivism, can motivate these attacks.

Обратно приходит действие пользователя и ничего больше — ни измерение компонента, ни запись из самого родителя. Поэтому состояние безопасно хранить в параметре маршрута: загрузка страницы этот параметр не перезапишет.

Предложения по улучшению
Если вы нашли ошибку или хотите доработать статью, создайте запрос на GitHub.