---
title: "Discussion on \"Angular dynamic classes using ngClass\" | Hashnode"
description: "Discussion on \"Angular dynamic classes using ngClass\". Yesterday, we looked at dynamic form fields, and it made me think about custom classes in Angular.\nYou might want to add class1 based on a condition or class2 if the condition is not met.\nHow can we achieve such a thing?\nWell, that is where the ngCla..."
url: "https://hashnode.com/posts/angular-dynamic-classes-using-ngclass/60641d836f6ec61457d8cab9"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Angular dynamic classes using ngClass](https://h.daily-dev-tips.com/angular-dynamic-classes-using-ngclass?utm_source=hashnode&utm_medium=feed)

Yesterday, we looked at dynamic form fields, and it made me think about custom classes in Angular. You might want to add class1 based on a condition or class2 if the condition is not met. How can we achieve such a thing? Well, that is where the ngCla...

Mar 31, 2021 · 2 min read · h.daily-dev-tips.com  
Read the article

-   [#angularjs](https://hashnode.com/tag/angularjs)
-   [#angular-2](https://hashnode.com/tag/angular-2)
-   [#angular](https://hashnode.com/tag/angular)
-   [#angular-4](https://hashnode.com/tag/angular-4)

## Written by

[Chris Bongers](https://hashnode.com/@dailydevtips)

@dailydevtips · Cape Town, SA

  
[View profile](https://hashnode.com/@dailydevtips)

Looking to get into development? As a full-stack developer I guide you on this journey and give you bite sized tips every single day 👊

I'm a full-stack developer from South Africa 🇿🇦. I love writing about JavaScript, HTML and CSS.

## Responses 1

Markdown supported · ⌘↵ to post

[Braydon Coyer](https://hashnode.com/@braydoncoyer)

[Mar 31, 2021](https://hashnode.com/posts/angular-dynamic-classes-using-ngclass/60641d836f6ec61457d8cab9/comment/606476ae574933157db92d89)

ngClass is super helpful! Thanks for sharing, Chris!

[Chris Bongers](https://hashnode.com/@dailydevtips)

[Apr 1, 2021](https://hashnode.com/posts/angular-dynamic-classes-using-ngclass/60641d836f6ec61457d8cab9/comment/606476ae574933157db92d89#reply-6065e3c1fad5042228d36059)

It is! You're welcome
