title: Drag and drop between several lists
body: <p>I have 4 lists of four different objects (A, B, C, D).</p>
  
  <p>Is there a way to associate a name with each of these lists? In other words, list A being A, B being B ...</p>
  
  <p>I intend to drag and drop an object and at the same time know which list it came from and where it went.</p>
  
  <p>I used this to find out the automatically generated list value <code>console.log ("FROM" + event.previousContainer.id)</code>
      <code>console.log ("TO" + event.container.id)</code>, the problem is that these values ​​sometimes vary, they are not always the same and if you use conditions it can stop working.</p>
  
  <p>Is there a way to assign or always get the same name from the list where it is object and the one in which it was dropped?</p>
  
  <p>Thanks</p>
  
  <p><strong><a href="https://stackblitz.com/edit/angular-4natzq?file=src%2Fapp%2Fapp.component.ts" rel="nofollow noreferrer">Demo- Stackblitz</a></strong></p>
  
  <p><strong>.ts</strong></p>
  
  <pre><code>  drop(event: CdkDragDrop&lt;string[]&gt;) {
      console.log("FROM" + event.previousContainer.id)
      console.log("TO" + event.container.id)
      if (event.previousContainer === event.container) {
        moveItemInArray(
          event.container.data,
          event.previousIndex,
          event.currentIndex
        );
      } else {
        transferArrayItem(
          event.previousContainer.data,
          event.container.data,
          event.previousIndex,
          event.currentIndex
        );
      }
    }
  </code></pre>