AbsaOSS / AbsaOSS/cps-shared-ui

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

Aperta
#309 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement library
Lingua principale
TypeScript
Stelle
9
Fork
6
Merge medio
23h 46m
PR unite (30g)
5

Descrizione

```
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();
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.