Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

119
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda