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

317
Views
how to bind boolean value in angular to the api?

I have bind value on option button

<select [(ngModel)]="pageInput.isValid">
  <option [value]="true">Valid</option>
  <option [value]="false">Not Valid</option>                            
</select>

2nd.html

<span [hidden]=""
*ngIf="pageInput.isValid== true" class="color">*</span>

when i comparing with this didn't get any change in my result or not showing error, if I comparing value with 'true' as a string I got result but I need value as a Boolean to the api, how can Solved this problem?? please help...

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You were almost there:

<option [ngValue]="true">Valid</option>
<option [ngValue]="false">Not-valid</option>

and then you can use this:

<span [hidden]="" *ngIf="pageInput.isValid" class="color">*</span>

and if you want to have the negative one:

<span [hidden]="" *ngIf="!pageInput.isValid" class="color">*</span>
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!