How do I use the Angular ngClass attribute?

The Angular ngClass attribute allows you to programmatically determine if a CSS class will be applied to an HTML element. We know that adding and removing CSS classes is a common JavaScript task. Quite often, it is the most efficient way to make style changes to one or more DOM elements. In fact, there is […]

How do I use the Angular ngIf Directive?

Angular’s ngIf directive does not simply hide and show. It creates and destroys an HTML element based on the result of a JavaScript expression. It’s perfectly fine to use the Angular ngIf directive to hide / show one or more HTML elements. This is the net effect and when used wisely, there is no problem […]