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

117
Views
How to control onselect before valuechanges

I want to understand below issue which i am facing . I have a form with formgroup in it . I have a multiselect tag in the html which consists of (select) = onSelect(event)

Now in ts file i am using value changes to the template refernce of the multiselect tag ! And also onSelect method

My html

  <ds-multi-select>
  #costcenter
  [items] = “listofitems”
  [label] = “labelkey”
  [value] = “valuekey”
  (Select) = “onselect($event)”
  </ds-multi-select>

Inside a method in my ts file i have

this.form.get(“costCenter”).valuechanges.pipe().subsribe (costcheck 
 => {
  …..

    });

Also have separate function

   OnSelect(selectedItem:any)
  {
  IsSelected = SelectedItem.IsselectedItem
  }

Now whenever i hit the dropdown list, the valuechanges is getting called first and then onSelect method. I want to use Isselected value from onSeelect function inside valuechanges. I want onSelect to be called first and use the valuechanges later.

I also tried to check in the valuechanges event if I could catch the checkbox is selected or not attribute but couldn't find anything !

Please help with the correct solution !

about 4 years ago · Juan Pablo Isaza
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!