Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

194
Views
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 answers
Answer question

0

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

statusFilter = 'Choose';

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!