Open
Description
I am wanting to bind the validation error to my template with NG4, however given the current output of ValidationError[] I have to iterate to find the offender and then pull the message. I then have to bind the message to an object that is bound to the error for that field. I would be nice to get an object output instead of an array that could be bound to.
validationErrors: {
<fieldName>: [{constraint: <constraintName>, message: <actualMessage>}],
<anotherFieldName: [{...},{...}],
...
}
Where in the template I could bind to this result with angular4
<div *ngFor="let err of resultModel.email">
{{err.constraint}}{{err.email}}
</div>
<input type="email" [(ngModel)]="model.email">