leewinder / ng2-file-drop

An Angular module for simple desktop file drag and drop with automatic file validation and dynamic style adjustment.
MIT License
28 stars 26 forks source link

No provider for ElementRef! #52

Open iamnaj1 opened 6 years ago

iamnaj1 commented 6 years ago

In my HTML I got ngb tabset component:

It gives this error.

ERROR Error: StaticInjectorError[ElementRef]: StaticInjectorError[ElementRef]: NullInjectorError: No provider for ElementRef! at NullInjector.get (core.js:993) at resolveToken (core.js:1281) at tryResolveToken (core.js:1223) at StaticInjector.get (core.js:1094) at resolveToken (core.js:1281) at tryResolveToken (core.js:1223) at StaticInjector.get (core.js:1094) at resolveNgModuleDep (core.js:10878) at NgModuleRef.get (core.js:12110) at resolveNgModuleDep (core.js:10878)

My environment: Angular CLI: 1.6.3 Node: 8.9.4 OS: win32 x64 Angular: 5.1.2

I followed the installion: npm install ng2-file-drop --save. I imported Ng2FileDropModule inside app module and also on the module where I wanted the ng2fileDrop to work.

Then I tried putting this to tsconfig.json for a temporary fix workaround based on build failed at Angular 5:

"include": [ "src//*", "node_modules/ng2-file-drop/*/.ts", "node_modules/tslerp//*.ts" ].

Please help. THanks

jordiJIG commented 6 years ago

Same issue here!!

Any idea?

tempurai commented 6 years ago

"preserveSymlinks": true in angular-cli.json or angular.json solve the problem

ersatish commented 6 years ago

I had also faced this issue and after cleaning my application packages (node_modules folder) and reinstalling packages this has been resolved.

I think there is something else problem caused it.