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)
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:
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
Same issue here!!
Any idea?
"preserveSymlinks": true in angular-cli.json or angular.json solve the problem
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.