#How can i enable-disable this input form?

1 messages · Page 1 of 1 (latest)

astral holly
#

the thing is that i want to enable or disable other inputs by enabling "Protesis" input.

Ts:

      this.incidenteForm.get(FieldConstants.FIELD_GROUP_NAME_REQUERIMIENTO).get(FieldConstants.FIELD_NAME_PRESTACION).setValue(' ');
      let resultado :any;
      switch(value){
        case 'Prótesis' :
          resultado = await this.nomencladorService.getNomencladorProtesis().toPromise();

        break;

        case 'Medicamentos':
          const dataMedicamento = await this.medicamentoService.getMedicamentosByGroup().toPromise();
          resultado =dataMedicamento.items;
        break;

        case 'Otras Prestaciones':
          const nomenclador = await this.nomencladorService.getNomencladoresByGroup().toPromise();
          resultado =nomenclador[1].items;
        break;

      }
      this.prestacionFullAutocomplete = ComponentUtils.populatePrestacionesAutocomplete(resultado,value);
    }

HTML:

<mat-select
                (ngModelChange)="onChangeTipoPrestacionControl($event)"

                    formControlName="tipoPrestacion">
                    <mat-option>--</mat-option>

                    <mat-option
                        id="option_{{ item.key }}"
                        *ngFor="let item of tipoDePrestacionOptions"
                        [value]="item.value"
                    >
                    {{ item.value }}
                    </mat-option>
                </mat-select>
terse dust
#
<input [disabled]="booleanVariableThatIsTrueWhenFieldShouldBeDisabled"

??

astral holly
#

you mean doing " <mat-select [disable]=booleanVariableThatIsTrueWhenFieldShouldBeDisabled>"?

terse dust
#

```html
would start an HTML code block with syntax highlighting
```

#

"disabled" and yes

astral holly
#

ok! thanks for the help!