I'm trying to get the x and y position of a box based on the position inside the container. Here's an example from https://material.angular.io.
I currently have this small demo to check the output of the cdkDragMoved
event.
<div class="something">
<div class="example-box" cdkDrag cdkDragBoundary=".something" (cdkDragMoved)="test($event)" (cdkDragEnded)="test($event)" (cdkDragReleased)="test($event)">
Drag me around
</div>
</div>
export class CdkDragDropOverviewExample {
test(e) {
console.log(e)
}
}
The desired output I would like is the position relative to the parent in either pixels or percentages.