I ran into a problem when the ng message blinks with a βmandatoryβ error message, despite the presence of input in the input field. What happens is that he blinks very briefly with the error message: "THIS FIELD IS REQUIRED (EVERYTHING IS IN CAPS TO GET IT TO SEE THIS FLASH !!") On the screen before it disappears right away. Sorry for the caps, but I wanted the message to be easier to see before it disappears.
Here is a link to my plunker . Enter any input, and then click elsewhere on the page so that the input field loses focus. Please note, because a short-term error message flashes briefly and then disappears. If you have not noticed that the message is blinking fast, you will have to reload the page again to see how it happens again.
Why is this happening? I believe this is due to ui-date because I cannot replicate the problem without ui-date.
Here is the code snippet:
<form name="reportform" ng-submit="process_form()" novalidate > <input name="startdate" placeholder="Enter a start date" ui-date ng-model="startdatevalue" required> <ng-messages ng-if='reportform.startdate.$touched' for="reportform.startdate.$error"> <ng-message when="required" class="error-message"> THIS FIELD IS REQUIRED (ALL IN CAPS TO MAKE IT EASIER TO SEE IT FLASH BY!) </ng-message> </ng-messages> <button ng-disabled="reportform.$invalid" type="submit"> Submit Query </button> </form>
Thank you for your help.
source share