I am having problems for implementing a simple server side form validation using angular 2.
given the following scenario:
- Simple form with login and password fields. (attached to the components view through ngForm / ngModel directives)
- Template based form
- Using Synchronous validation
- Server response JSON object has the following shape
{field: error}e.x, if login and password are empty response is:{login: 'required', password: 'required'}
Once it is submitted I have the response from server but I don't know how to update the state of each ngModel bound to a view control element to show it in the UI
It is a very common scenario and I am surprised that I am experiencing so many troubles of finding a proper documentation. (client validation is very well explained on the other hand)
Any help appreciated! Cheers :)