So, I have this following template.
<div dragula="'card-images'" [dragulaModel]="images">
<child-component [card]="imageCard" [ngClass]="cssClass(card)" *ngFor="let imageCard of images"></child-component>
</div>
The function cssClass sets the class based on the type of imageCard. So it is set to draggable and non draggable based on the type of image Card. Now, I want the child component to be draggable only if its property isSelected is true only after long press and this is done dynamically. How can I achieve this ? How to make child component draggable at run time ?
Thank you.
You can provide
moves
function and put the condition when the items should be dragable.In your case, you can do it two steps -
1. Add the class to element on the property based.
2. drag element if doesn't have the class
no-drag
.