Reputation: 36674
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.
Upvotes: 1
Views: 47
Reputation: 36674
Adding [hasError]
is the only thing that has worked for me:
<mat-step [stepControl]="gadsForm" [errorMessage]="stepperErrorMessage" [hasError]="stepperErrorMessage !== ''">
Upvotes: 0
Reputation: 27471
errorMessage
is an input property for the mat-step component, not an attribute
Please change the errorMessage
property as shown below:
<mat-step [stepControl]="gadsForm" [errorMessage]="showStepperError ? firstStepError : null">
Upvotes: 2