You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible for drag & drop to work when each list is contained within its own component?
I currently have code like the following. On a visual level, drag & drop works (except that items transferred between lists don't show up until a second item is transferred), but the items arrays' actual contents don't change.
Parent component:
import { Component, OnInit } from '@angular/core';
import { ItemsService } from '../items.service';
@Component({
selector: 'app-multi-list',
template: `
<h2>Drag / drop the item</h2>
<h3>list 1</h3>
<app-list [(items)]="itemsService.items1"></app-list>
<h3>list 2</h3>
<app-list [(items)]="itemsService.items2"></app-list>
<hr>
<h2>See the result</h2>
<div>
<h3>list 1</h3>
<div *ngFor="let item of itemsService.items1">{{ item }}</div>
<h3>list 2</h3>
<div *ngFor="let item of itemsService.items2">{{ item }}</div>
</div>
`,
styleUrls: ['./multi-list.component.css']
})
export class MultiListComponent implements OnInit {
constructor(public itemsService: ItemsService) { }
ngOnInit() { }
}
Is it possible for drag & drop to work when each list is contained within its own component?
I currently have code like the following. On a visual level, drag & drop works (except that items transferred between lists don't show up until a second item is transferred), but the
items
arrays' actual contents don't change.Parent component:
Child component that contains a sortable list:
The text was updated successfully, but these errors were encountered: