ngClass not working in my Angular Project
问题 I'm trying to make a form with validation, and I am using the following interface to define FieldError . export interface FieldError { errorAt: string; errorMessage: string; } In my component.html I am using [ngClass] to check if the FieldError.errorAt === 'first_name' I want to use text-danger and if not I want to use text-muted . It looks like following <div class="form-group text-left"> <label [ngClass]="{'text-danger':FieldError.errorAt==='first_name','text-muted':FieldError.errorAt!==