Angular CDK Drag and Drop added dynamically as a string not working
getAppointmentTemplate() { const checker = true; return `<div class=’appointment’ cdkDrag style=’padding: 0.5rem;margin: 0.2rem;background-color: #000;border-radius: 5px;color: #fff;’>✅booked</div>`; } I am calling this function to append to a div inside my html. But the atribute cdkDrag is not working or not getting applied. Screenshot of calendar component So I want to create a system where user inputs […]
How to add cdkDragHandle to dynamically generated element?
In an angular app using angular-cdk, I have a draggable container. Into the container elements are added dynamically. The container has cdkDrag directive, and one of the dynamically generated children should be the drag handle.
The position of source element rectangle position is confusion in angular cdkDragStarted
I am locating the offset position of mouse point when drag a div, suppose to be mouse.x-div.x is all I need, but the div.x is a large negative number(-15984). I am wondering why, and how to resolve the issue.