Hide select option when it is equal to the already chosen option

0

I have a select that has two options:

Size, Color.

When I select Size, when I click again on my select, it still shows Size as an option.

I would like to remove it and leave only the other available, as it has already been selected.

I tried this logic:

<select [class.disabled]="loadingcadastro" (change)="getIdTipoVariacao(item.value.tipo)"
  formControlName="tipo" class="browser-default custom-select">
  <option class="dropdown-item" selected>{{item.value.tipo || 'Tipo da Variação'}}</option>
  <option [hidden]="item.value.tipo === tipoVariacao.valor" *ngFor="let tipoVariacao of tiposvariacoes;let j = index"
  class="dropdown-item">{{tipoVariacao.valor}}</option>
</select>

Must-onlythe"Color" option appears because the size is already selected.

    
asked by anonymous 08.11.2018 / 16:08

0 answers