Correction de l'utilisation de l'attribut "disabled" dans le modèle du composant "entity-edit" au lieu d'utiliser l'attribut du contrôle.
This commit is contained in:
parent
ecdb6f52c8
commit
93bae1504b
|
@ -61,7 +61,7 @@
|
|||
let-control="control" let-field="field">
|
||||
<mat-form-field *ngIf="field.options$ | async as options">
|
||||
<mat-label>{{field.label}}</mat-label>
|
||||
<mat-select [formControl]="control" [disabled]="field.readonly">
|
||||
<mat-select [formControl]="control">
|
||||
<mat-option *ngFor="let option of options" [value]="option.value">
|
||||
{{option.label}}
|
||||
</mat-option>
|
||||
|
|
|
@ -38,7 +38,7 @@ export class EntityEditComponent extends SubscribingComponent {
|
|||
ngOnInit() {
|
||||
const formGroup = {}
|
||||
this.formFields.forEach(f => {
|
||||
formGroup[f.name] = new FormControl(f.valueFn ? f.valueFn(this.entity) : this.entity[f.name], f.validator)
|
||||
formGroup[f.name] = new FormControl({value: f.valueFn ? f.valueFn(this.entity) : this.entity[f.name], disabled: f.readonly}, f.validator)
|
||||
})
|
||||
this.form = this.formBuilder.group(formGroup)
|
||||
|
||||
|
|
Loading…
Reference in New Issue