danialfarid / ng-file-upload

Lightweight Angular directive to upload files with optional FileAPI shim for cross browser support
MIT License
7.87k stars 1.6k forks source link

Importing in app.module.js #2092

Open yglodt opened 5 years ago

yglodt commented 5 years ago

I seem to be unable to correctly import ng-file-upload in my new Angular 6.1.6-based project.

As soon as I add this to app.module.ts:

import {ngFileUpload} from 'ng-file-upload';

I get this:

Uncaught ReferenceError: angular is not defined
    at Object../node_modules/ng-file-upload/dist/ng-file-upload-all.js (ng-file-upload-all.js:446)
    at __webpack_require__ (bootstrap:76)
    at Object../node_modules/ng-file-upload/index.js (index.js:1)
    at __webpack_require__ (bootstrap:76)
    at Object../src/app/app.module.ts (app.component.ts:20)
    at __webpack_require__ (bootstrap:76)
    at Object../src/main.ts (environment.ts:15)
    at __webpack_require__ (bootstrap:76)
    at Object.0 (main.ts:16)
    at __webpack_require__ (bootstrap:76)

What else must be done to import it correctly?