Unexpected token u in JSON at position 0 when using directives and sorting items
See original GitHub issueI’m submitting a … (check one with “x”)
[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here
Current behavior
When you drag & drops an item into an item, everything is fine, also when you drags the dropped item back into the place which has no children, but when you drag & drops an item between two items, so not into an item, I get the following error Unexpected token u in JSON at position 0
Sidenote: when I log ‘orderableList’ into my controller, I get the originally list, not the one which is shown, how can I get this?
Expected behavior Drag & drop items into an item + drag & drop item between items should behave correctly
Reproduction of the problem
<div class="ngx-dnd-container"
ngxDroppable [model]="orderableList" #wtftest>
<div class="sensor-big-container has-handle"
ngxDraggable ngxDroppable (drop)="onDropSuccess($event)"
*ngFor="let sensorGroup of orderableList" fxLayoutGap="14px" [model]="sensor" style="border:1px solid red">
<div fxFlex class="sensor-container" *ngFor="let sensor of sensorGroup.children" fxLayoutGap="14px">
<mat-icon svgIcon="sensor"></mat-icon>
<span fxFlex>{{sensor.name}}</span>
<mat-icon ngxDragHandle class="draghandle" svgIcon="draghandle"></mat-icon>
</div>
</div>
</div>
this.orderableList = map(this.sensors, ((sensor: MonitorSensor) => {
return {label: '', children: [sensor]}
}));
What is the motivation / use case for changing the behavior? needs to drag an item and drop into it as well
Please tell us about your environment: OSX
-
Angular version: 5.1.1
-
Browser: [all]
-
Language: [ TypeScript 2.6.2 ]
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:9 (4 by maintainers)

Top Related StackOverflow Question
@elineopsommer Darn, looks like the plunker didn’t get saved correctly. I had to redo it… again, notice that the each droppable and draggable has a [model].
https://embed.plnkr.co/FH9gGy/
This seems to be pointed to as a sort of documentation by example issue, however this plunker does not work for me. Can the plunker be fixed, or is there some other way to host or view this example?