Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

86
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda