👩💻 Join our community of thousands of amazing developers!
There are times when you need to set a css class of a html element dynamically in angular, given a simple or complex condition. This was the case for me when I had to set a different backround-color and color attributes for an anchor a html element to display the latest searches on the landing page of Codever Use ngClass (before) You can do it by setting the desired css class directly to the ngClass input of the element. The thing is if the condition gets complex, as in my case where I used in...