angularangular-materialangularjs-directive

how can I dynamically remove an error at the ng-stepper level?


I was trying to use this angular HTML

<mat-stepper #stepper>
  <mat-step [stepControl]="gadsForm" [attr.errorMessage]="showStepperError ? firstStepError : null">

But regardless of showStepperError's value - the stepper always shows an error.

enter image description here


Solution

  • Adding [hasError] is the only thing that has worked for me:

    <mat-step [stepControl]="gadsForm" [errorMessage]="stepperErrorMessage" [hasError]="stepperErrorMessage !== ''">