How can i get dragged item data in metarial drag and drop

Discussão em 'Angular' iniciado por Trinity, Dezembro 31, 2024.

  1. Trinity

    Trinity Guest

    I'm learning angular. My first application is todolist. I'm trying to develop it by using nodejs and mongodb. There are three container such as todos doings and dones. When i drag an item from todos to doings i want to handle it's id. How can i do that ?

    drop(event: CdkDragDrop<string[]>) {
    if (event.previousContainer === event.container) {
    moveItemInArray(event.container.data, event.previousIndex, event.currentIndex);
    } else {
    transferArrayItem(event.previousContainer.data,
    event.container.data,
    event.previousIndex,
    event.currentIndex);
    }

    ///TODO handle dragged item id,title or someinformation


    }

    Continue reading...

Compartilhe esta Página