Skip to content

CDK Drag-Drop - Object Configuration on attributes #17921

@KevynTD

Description

@KevynTD

Feature Description

Implementing the possibility of elements with only one attribute and one object passing all the options, is more organized and easier to deploy.

Example:

<div [DragDropList]="{
listID: 'idlist1',
listConnectedTo: ['list2', 'list3', 'list4', 'list5'],
listData: list1,
listOrientation: 'horizontal',
listDropped: dropListDropped($event)
}" > ... </div>

<!-- OR --->

<div [DragDropList]="DragDropListConfigObj"> ... </div>

<!-- OR --->

<div [DragDropList]="{ listID: 'idlist1', ...DragDropListConfigObj }"> ... </div>

And another for the list elements:

<div [DragDropItem]="{
itemData: item,
itemDisabled: false,
itemMoved: dragMoved($event),
cdkDragReleased: dragReleased()
}" *ngFor="let item of list1; let item = i"> item </div>

<!-- OR --->

<div [DragDropItem]="DragDropListConfigObj" *ngFor="let item of list1; let item = i"> item </div>

Use Case

Facilitates the library learning curve and also enables easier and more organized changes. could be applicable on any Angular-Drag-Drop. I don't think it's hard to do, but if you want you wouldn't need to make a bigger effort to start a deployment method since the library already provides one.

Metadata

Metadata

Assignees

Labels

P2The issue is important to a large percentage of users, with a workaroundfeatureThis issue represents a new feature or feature request rather than a bug or bug fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions