'Getting Inner Text of dragged Element in Angular Material DragAndDrop
Is there any way to get the innerText of the dragged element and use it in "onDrop" function on angular cdkDragAndDrop ?
onDrop(event: CdkDragDrop<string[]>) {
if (event.previousContainer === event.container) {
moveItemInArray(event.container.data, event.previousIndex, event.currentIndex);
}
else {
console.log(DraggedElementInnerText)
this.addItemInPostion(event.currentIndex,DraggedElementInnerText)
}
}
Solution 1:[1]
Problem solved :
this how to get the dragged element: event.previousContainer.data[event.previousIndex]
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
