I´m making a component which takes a FormControl as an input.
In this component, i´d like to disable a button if the formControls value equals the Validator.max() value.
this.formC = this.fb.control( // formcontrol created in the parent component
maxValue,
[
Validators.max(maxValue),
Validators.min(1),
Validators.required
]);
<!-- Button used in the child component -->
<button
mat-flat-button
color="accent"
[disabled]="maxValue" // here I´d like to get the Validators.max() value
(click)="increaseQuanity()"
>+</button>
I could of cause just parse the max value as an @Input(), but I was hoping to find a more elegant way.