I'm having difficulty figuring out how to setup tether-drop with my angular 2 app created with angular-cli@1.0.0-beta.24.
Steps to reproduce:
ng new tester --skip-git
npm install tether-drop --save
npm install @types/tether-drop --save
import { Drop } from 'tether-drop';
But when I ng serve
the result is this error:
ERROR in ./src/app/app.component.ts
Module build failed: Error: D:/Visual Studio Code/tester/src/app/app.component.ts (3,10): Module '"D:/Visual Studio Code/tester/node_modules/@types/tether-drop/index"' has no exported member 'Drop'.)
at _checkDiagnostics (D:\Visual Studio Code\tester\node_modules\@ngtools\webpack\src\loader.js:116:15)
at D:\Visual Studio Code\tester\node_modules\@ngtools\webpack\src\loader.js:141:17
@ ./src/app/app.module.ts 14:0-47
@ ./src/main.ts
@ multi main
I have struggled mightily with integrating third party libraries into angular-cli generated projects (webpack). I managed to get some of them working but a solution for this one is alluding me.
Can someone please enlighten me and remove this burden of ignorance from me?
It seems that you need to change your import to:
import * as Drop from 'tether-drop';
And then you can use it as per the README:
const dropInstance = new Drop({ /* options here */ });