如何在提交表单的重置表单验证在ANGULAR 2 [英] How to reset form validation on submission of the form in ANGULAR 2

查看:287
本文介绍了如何在提交表单的重置表单验证在ANGULAR 2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要使用验证以及重置我的表单。有没有从NG-脏NG-质朴重置表单的状态的任何方法。

I have to reset my form along with validation. is there any method to reset the state of form from ng-dirty to ng-pristine.

推荐答案

似乎没有成为那支呢。
我所看到的一种解决方法是重新创建表单提交后这显然是繁琐和丑陋的。

There doesn't seem to be support for that yet. A workaround I have seen is to recreate the form after submit which is obviously cumbersome and ugly.

另请参见

  • https://github.com/angular/angular/issues/6196
  • https://github.com/angular/angular/issues/4933
  • https://github.com/angular/angular/issues/5568
  • https://github.com/angular/angular/issues/4914

这篇关于如何在提交表单的重置表单验证在ANGULAR 2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆