Angular 5 : Validating disabled fields

标签 angular validation angular5 disabled-control

我找到了 this post但它不能解决我的问题。我无法验证禁用 FormControls 的简单表单。我确实在这里做了一个 stackblitz 示例,请查看我的代码并验证如果名称控件被禁用,则无法验证它的值。
Stackblitz code
先感谢您。

最佳答案

Solution by @Eliseo :

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/

相关文章:

node.js - Meteor - rxjs@5.0.0-beta.11 或 rxjs@5.0.0-beta.6 未满足的依赖项

python - Django 绑定(bind)表单无效,但未引发 ValidationError

javascript - JQuery Validation 重新验证

angular - 如何以 Angular 隐藏引导模式

angular - 如何使用 Angular 5 在单击按钮时调用多个方法?

regex - ng build 由于 regExp 而给出错误

angular - WebStorm - 参数类型 {providedIn : "root"} is not assignable to parameter type {providedIn: Type<any> | "root" | null} & InjectableProvider

angular5 - 为什么 ngx-bootstrap 工具提示在某些层下

Angular:在 ngFor 中获取当前索引

asp.net-mvc - .NET MVC 和 SalesForce 下拉列表问题