I'm developing multi-page web application (not an Angular SPA).
In some cases I have to render pages with embedded validation errors (like failed login attempt after HTTP POST).
I want these errors to be displayed by angular on page load.
I've created custom validator (directive called it odd
for now).
But it seems that the only way to have them displayed is to blur from each individual input field.
<md-input-container>
<label>Email</label>
<input name="j_username" type="email" ng-model="j_username" odd="false" md-autofocus />
<div ng-messages="login.j_username.$error">
<span ng-message="odd">Some error message prerendered on a server side</span>
</div>
</md-input-container>
Here is a link to codepen: http://codepen.io/anon/pen/RGRgoN Click on email and then loose focus, you'll see error message appears.
Question is: how to force angular to display all validation messages for all fields on a form on page load?