SortableJS / ngx-sortablejs

Angular 2+ binding to SortableJS. Previously known as angular-sortablejs
https://sortablejs.github.io/ngx-sortablejs/
MIT License
465 stars 160 forks source link

Module '"ngx-sortablejs"' has no exported member 'SortablejsOptions'.ts in Angular 12 #251

Open kibria06cse opened 2 years ago

kibria06cse commented 2 years ago

I am using Angular 12 version and ngx-sortablejs v11.1.0.

I used this options on a previous angular version. But whenever I upgrade from the angular and ngx-sortablejs version, I am getting this error.

Is there any alternatitve?

tehZeno commented 2 years ago

Had the same issue, this works for me:

import {Options} from 'sortablejs'; ..

eventOptions: Options = {
    onUpdate: () => this.eventUpdateCounter ++
  };
scuglik commented 2 years ago

I needed options for dragging beetween multiple list. I marked options as any type in typecsript without any imports and it works.... But only as temporary solution I hope import will be fixed soon :)

options: any = { group: 'groups', draggable: '.draggable', };

tehZeno commented 2 years ago

I needed options for dragging beetween multiple list. I marked options as any type in typecsript without any imports and it works.... But only as temporary solution I hope import will be fixed soon :)

options: any = { group: 'groups', draggable: '.draggable', };

did you try my suggestion? (import {Options} from 'sortablejs';)

(strangely enough I only get onStart events, but for other options should hopefully just work)

scuglik commented 2 years ago

did you try my suggestion? (import {Options} from 'sortablejs';)

Yes with a little edit import { SortableOptions } from 'sortablejs'; to keep same types as in example and it works. Thank you very much