dotmindlabs dotmindlabs - 1 month ago 23
AngularJS Question

Webpack ES6 import of ngJsTree

Hello need to import ngJsTree with webpack on ES6.

After
npm install ng-js-tree --save

I tried:

import jstree from 'ngJsTree';
or import * as jstree from 'ngJsTree';

but always get:
Module not found: Error: Cannot resolve module 'ngJsTree'

should i use require and how?

Answer

If you installed it as ng-js-tree, then it will be available as ng-js-tree.

Therefore try importing as:

import ngJsTree from 'ng-js-tree';