estevan gomez estevan gomez - 1 year ago 243
AngularJS Question

Angular2 Setting up ng2-dragula (Instructions Incomplete)

I am using Angular2 RC1 and I've install NG2-Dragula from here:

In the documentation for setup on the link all it says you need to do to get it working is:

You'll need to add DragulaService to your components viewProviders and
also add Dragula to your components directives.

But adding Dragula for the directives area on my component will not get it to work as I'll get error:
Unresolved variable or type Dracula
... It will at least need an import right?

Does anyone know how to set ng2-dragula up because the instructions are incomplete?


In your systemjs.config.ts you have to add a few things.

To the map variable:

'ng2-dragula':                'node_modules/ng2-dragula',
'dragula':                    'node_modules/ng2-dragula'

and to packages add:

'ng2-dragula': { main: 'ng2-dragula.js', defaultExtension: 'js' }

This will tell SystemJS where to look for your packages.