Actual behavior:
md-input-container directly if the user hits SAVECodePen or Steps to reproduce the issue: *
SAVE button and there is no indicator that the md-select is required. This is misleading and it is currently impossible to show ng-messages to required attribute on md-select elements.FAVORITE NUMBER and hits CLEAR the ng-messages are shown correctlyAngular Versions: *
Additional Information:
@dohomi Thanks, we'll look into this.
@topherfangio thanks for looking into it. Similar handling happens to the md-datepicker reported here: https://github.com/angular/material/issues/8411
Un-deprecating as this deals with basic/expected functionality of form errors.
Same happens in material version 1.1.rcx: http://codepen.io/anon/pen/LZPvdB
The asterix is not showing on pristine input so the user does not have an indication that the field is required at all.
Still not working on pristine input.
Example based on forked original demo with the latest versions of angular 1.6.2 and angular material 1.1.3. Until the user interacts with the select, the required notification is not shown when pushing the save button:
@gerardcarbo I looked at your Codepen, as I was having the same issue, but I think I figured it out.
type="submit" to the md-button element fixed it in your example.ng-if="myForm.$dirty" on the ng-messages div. That bit is unnecessary, and was stopping the messages from ever popping up for me.
Most helpful comment
Still not working on pristine input.
Example based on forked original demo with the latest versions of angular 1.6.2 and angular material 1.1.3. Until the user interacts with the select, the required notification is not shown when pushing the save button:
http://codepen.io/gcarbo/pen/yMPjXB