Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

271
Visualizações
Angular (2) Server side form validation (and best practices)

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 :)

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I have been looking all over the internet for server-side validation models, and i haven't find any official documentation, but instead, i got some useful articles - one of them from Stack Over~ - which may help you a little. I have not tested yet, still looking for infos and maybe you have already found an answer for your problem. Anyway, here is a short list with articles about server-side validations using different API:

https://www.carlrippon.com/integrating-validation-in-angular-2-and-asp-net-core/

https://www.puzzle.ch/blog/articles/2017/01/18/server-side-validations-with-angular-2

Angular 2 (Beta) Server side validation messages

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda