我启用了dragzone属性,添加的筹码现在可以拖动。 那么拖动之后,我们如何获得当前的筹码顺序?
答案 0 :(得分:2)
与往常一样,您可以使用two way binding。实际上,您可以从binded ngmodel值中获取订单。
在输入内部拖放的示例:
<div>
<h3>Drag and drop</h3>
<tag-input [(ngModel)]="dragAndDropExample"
[modelAsStrings]="true"
[dragZone]="'zone1'"
[editable]="true">
</tag-input>
</div>
在输入之间拖放的示例代码:
<div>
<h3>Drag and drop (as string) can be moved to another tag-input (to the next)</h3>
<tag-input [(ngModel)]="dragAndDropStrings"
[modelAsStrings]="true"
[dragZone]="'zone1'"
[editable]="true">
</tag-input>
</div>
<div>
<h3>Drag and drop (as object) can be moved to another tag-input (to the previous)</h3>
<tag-input [(ngModel)]="dragAndDropObjects"
[dragZone]="'zone1'"
[editable]="true">
</tag-input>
</div>