如何使用 Angular 8 动态创建下拉列表项?

How to create droplist items dynamically with Angular8?

我发现了很多如何使用不同的可拖动指令的简单示例,但现在我想以编程方式执行此操作。有一个演示该问题的最小示例应用程序。 它接收 "dropped" 事件,但 previousIndex 和 currentIndex 始终相同。

https://stackblitz.com/edit/angular-8-drag-and-drop-dynamic-components

点击几次添加按钮,然后尝试移动它们。

问题是(曾经)是一个真正的错误:https://github.com/angular/components/issues/16961