I'd like to show the MDL error message on a quantity text field when the user tries to send a form leaving the field empty. The field is like:
<mdl-textfield
#quantityBox
type="text"
label="Num."
pattern="-?[0-9]*(\.[0-9]+)?"
error-msg="Insert a number!"
[(ngModel)]="selectedBoxQuantity"
floating-label
class="no-wrap"></mdl-textfield>
I can access to the field component calling a ViewChild:
@ViewChild('quantityBox') private quantityBox: MdlTextFieldComponent;
But apparently I can only change the error message:
this.quantityBox.errorMessage = "New error message";
How can I force the message without entering an invalid value in the input field?
What I'd like to achieve is similar to this when I click/tap on the + button: