Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

193
Vistas
Unable to show HTML select option initially when starting the page in Angular

in my ts file I've defined this :

  statuses = [
    { id: 1, name: "Approved" },
    { id: 2, name: "Created" },
    { id: 3, name: "Rejected" },
    { id: 4, name: "Cancelled" },
  ];

in my HTML here is the code

<div class="col-1" id="statusFilter">
      <label class="font-weight-bold text-secondary" for="statusFilter">Filter By Status:</label>
      <select
        [(ngModel)]="statusFilter"
        class="form-control"
        (change)="setStatusFilter()">
        <option value="'Choose'" disabled selected><strong> Choose Filter: </strong></option>
        <option *ngFor="let status of statuses" [value]="status.name">
            {{ status.name }}
        </option>
    </select>
</div>

what appears in the Angular App is this empty select, my goal is to make the first tag show its value 'Choose Filter: ' before selecting anything

here is how it currently appears: enter image description here

and this is what I need it to appear desired result

and for information this is how the select list would appear if I click it, I would be able to see that disabled option inside of it only if clicked but not by default select list clicked

Any idea what i'm doing wrong in here ?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

you should fill statusFilter with "Choose" value in the "ts" file.

statusFilter = 'Choose';

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda