我找到了 this post但它不能解决我的问题。我无法验证禁用 FormControls 的简单表单。我确实在这里做了一个 stackblitz 示例,请查看我的代码并验证如果名称控件被禁用,则无法验证它的值。
Stackblitz code
先感谢您。
最佳答案
If you want not loose the validate you can use
[attr.disabled]="condition ? true : null"
(or any condition). This give your control an apparence of disabled but still is "validating".
关于 Angular 5 : Validating disabled fields,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54522845/