Angular 5: Validating disabled fields

2019-08-27 05:23发布

I found this post but it cant solve my problem. I can't validate a simple form with FormControls disabled. I did make a stackblitz example here, please check out my code and verify that is impossible to verify the value of the name control if it's disabled.

Stackblitz code

Thank you in advance.

1条回答
Root(大扎)
2楼-- · 2019-08-27 06:28

Solution by @Eliseo:

If you want not loose the validate you can use [attr.disabled]="true" (or any condition). This give your control an apparence of disabled but still is "validating".

查看更多
登录 后发表回答