Install Dragula
npm install dragula --save
Install Dragula typings
npm install @types/dragula --save
We would usually install ng2-dragula from npm, but that is failing with Ionic2 RC0 because it has angular/common version 2.0.0 as a dependency. To use 2.1.0 we can download the zip and load it from the src dir as a custom module
Download ng2-dragula-master.zip
to a new app/src/modules
directory and unzip it
https://github.com/valor-software/ng2-dragula
Next, ng2-dragula is also breaking when importing the dragula namespace, so in:
modules/ng2-dragula-master/components/dragula.directive.ts
modules/ng2-dragula-master/components/dragula.provider.ts
change:
import * as dragula from 'dragula';
to:
import dragula from 'dragula';
Then import DragulaModule
in src/app/app.module.ts
. We also add DragulaModule
to the @NgModule imports
array.
If you want to set ng2-dragula config options, add import the DragulaService
in src/app/app.components.ts
.
See the other files in this gist for the full file.
Now ionic serve
should run fine.