0

I tried to use index i from loop in div element like id="list-{{i}}":

<div cdkDropList id="list-{{i}}" [cdkDropListConnectedTo]="['list-{{i}}']"
*ngFor="let group of subGroups; let i = index"></div>

But it does not work for me.

Also I tried:

cdkDropList id="{{'list-' + i}}" [cdkDropListConnectedTo]="[{{'list-' + i}}]"
1
  • 1
    Have you tried ['list-' + i] Commented Feb 1, 2019 at 11:29

1 Answer 1

1

Don't interpolate instead use string concatenation

 [cdkDropListConnectedTo]="['list-' + i]"
Sign up to request clarification or add additional context in comments.

2 Comments

How dinamicly create this? #doneList="cdkDropList"? like #doneList_1, #doneList_2
@OPV, Please elaborate

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.