marceljuenemann / angular-drag-and-drop-lists

Angular directives for sorting nested lists using the HTML5 Drag & Drop API
MIT License
2.16k stars 712 forks source link

Using with webpack es6 #361

Open harilalinapp opened 7 years ago

harilalinapp commented 7 years ago

How to use this library with webpack/es6?

import 'angular-drag-and-drop-lists/angular-drag-and-drop-lists';

its not working with this import. Can't inject it to the module.

nmarcetic commented 7 years ago

Confirming, not working with webpack./es6 , can't inject the module.

harilalinapp commented 7 years ago

I got a solution

import dndLists from 
export default angular 'angular-drag-and-drop-lists/angular-drag-and-drop-lists';
    .module('dashboard.controller', [dndLists])
    .controller('DashboardController', ['commonService', DashboardController]);
flowermm commented 7 years ago

This issue will be fixed with PR https://github.com/marceljuenemann/angular-drag-and-drop-lists/pull/350. Currently angular-drag-and-drop-lists.js is not exporting anything for imports in ES6.

juansupp commented 7 years ago

@harilalinapp and... where is the solution?

rjkunde commented 6 years ago

Also looking for a fix!

MatheusArleson commented 6 years ago

also looking for a fix.

fromcouch commented 5 years ago

Quick solution:

import 'angular-drag-and-drop-lists/angular-drag-and-drop-lists'; angular.module('appName', ['dndLists']);

it's important to add quotes to dndLists word inside angular.module.