ngClass Directive in Angular | Directives | Angular 12+

preview_player
Показать описание
In this lecture, you will learn about ngClass directive. The ngClass is a built-in directive of angular and it is used to set a CSS class of an HTML element dynamically based on a given typescript expression.

In this lecture, let's learn about ngClass directive with an example, and how we can use it to set the CSS class of an HTML element dynamically.
Рекомендации по теме
Комментарии
Автор

This one is interesting too. Good job!

gabrieldonizettidario
Автор

it is fading out but the search input should take its space right? there is an empty space after closing the notification

JaySharma
Автор

NG8002: Can't bind to 'ngСlass' since it isn't a known property
of 'button

ADA-yldm
Автор

For some reasons on my side It works only with 'fadeOut' [ngClass]="{ 'fadeOut': displayNotification }" with speech marks, otherwise it throws error.

Anyway, thank you very much for your service. Looking forward to learning with the rest of the course.

lacertezzadellapena
Автор

Where are all lectures after Lec no. 22 of eShopping?

gjlyxqx
Автор

.fadeOut {
visibility: hidden;
opacity: 0;
transition: 0s 2s, opacity 2s linear;
}

this is the code if you are using external css
styleUrls

mightyprogrammer
Автор

can i get the source code because i want to modify and see how it works

bohthard
Автор

".fadeOut {visibility: hidden; opacity:0; transition: visibility 0s 2s, opacity 2s linear;}"

shahidshaikh
Автор

add class renderer you would have shown

urwrong