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 摘要。