1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Changing boundary of multiple cdkDrag elements in the same div

Discussão em 'Angular' iniciado por user6781, Junho 6, 2025.

  1. user6781

    user6781 Guest

    I have a child component which contains a cdkDrag element, and I am showing multiple samples of it inside a div in a parent component as bellow:

    <div [ngClass]="items[id].someFlag ? 'boundary-class' : 'non-boundary-class'">
    @for (item of items; track item; let index = $index) {
    <app-child> </app-child>
    }
    </div>



    I need to show all children in the same div but the div class changes based on a flag from the child element. Because bounding is important only when an element is selected and is dragged, is it possible to change the div class based on the selected element?

    Continue reading...

Compartilhe esta Página