AbsaOSS / AbsaOSS/cps-shared-ui

Support built-in disabling mechanism for reactive form controls instead of applying disabled attribute

未关闭
#309 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement library
主要语言
TypeScript
星标
9
派生
6
平均合并
23 小时 46 分钟
30 天内合并 PR
5

描述

```
It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true
when you set up this control in your component class, the disabled attribute will actually be set in the DOM for
you. We recommend using this approach to avoid 'changed after checked' errors.

Example:
// Specify the `disabled` property at control creation time:
form = new FormGroup({
first: new FormControl({value: 'Nancy', disabled: true}, Validators.required),
last: new FormControl('Drew', Validators.required)
});

// Controls can also be enabled/disabled after creation:
form.get('first')?.enable();
form.get('last')?.disable();
```

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。