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

87
Visualizações
How edit only one item with .fill method

I have a div with several items that can be chosen and have their fields edited, the edition is working but the edition is changing all the fields and all the items too.

This is the html of when I select one of the items

<div cdkDropList id="{{ordem.id}}" [cdkDropListData]="ordem.secoes" [cdkDropListConnectedTo]="idsOrdens" class="example-list" (cdkDropListDropped)="drop($event,ordem)">
  <div class="col-12 border rounded-3 bg-claro-color col-12 p-3 mb-3 d-flex justify-content-between" *ngFor="let item of ordem.secoes" cdkDrag>
     {{item.nomeSecaoPT}}
     <button (click)="EDIT(item)" type="button" class="btn btn-primary-color rounded-pill d-flex align-items-center px-5 py-2 h7 fw-500" >
       Edit Question
     </button>
  </div>
</div>

And this is the function that html calls

EDIT(item: any): void{
    console.log(item)
    let modalEditarSecao = this.modalService.open(ModalEditPerguntaComponent, {
      centered: true,
      beforeDismiss: () => true,
      size: 'md'
    });

    modalEditarSecao.componentInstance.item = item;

    modalEditarSecao.result.then((data) => {
      if(data){

        this.workflow[0].secoes?.fill(data, undefined, undefined);
      }
    })
  }

I'm pretty sure the problem is in the .fill() method, I think it's taking the value of 1 changed field and passing it on to all other items. however I don't know which method to use, I've tried many and I'm stuck on it for a few days, only the .fill "worked"

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