bonjurmrfirst / ng4-files

20 stars 15 forks source link

Using ./ng4-files generates an error of can't find module ! #11

Open redasakhi opened 6 years ago

redasakhi commented 6 years ago

Hi, I've tried to integrate via npm install and follow the readme but it doesn't work out of the box ! I don't know what i am missing here ! i've replaced "./ng4-files" by "angular4-files-upload" and now it says "'ng4-files-drop' is not a known element"

jogueber commented 6 years ago

Same Issue here, any Ideas? I use : import {Ng4FilesModule} from "angular4-files-upload; and imports:[Ng4FilesModule] and I get the issue: Unexpected value 'Ng4FilesModule' imported by the module 'PricingAppFileUploadModule'. Please add a @NgModule annotation `

nosliwsirhc commented 6 years ago

I'm having the same problem. Installed it, added the module to app.module.ts and instantly my text editor lit up saying it couldn't be found. I saved anyways which triggered webpack and threw "Cannot find module './ng4-files'." I haven't tried using angular4-files-upload as a source since jojo19893 and redasakhi have both had issues with that as well.

stuart-clark-45 commented 6 years ago

The docs need updating both on this repo and also on NPM, if that isn't auto generate from the read me never uploaded anything myself.

Use this...

import { Ng4FilesModule } from 'angular4-files-upload';
mjurczyk commented 6 years ago

@stuart-clark-45 @redasakhi @jojo19893 @nosliwsirhc

https://github.com/bonjurmrfirst/ng4-files/pull/14 - Uploaded a revised README.md version explaining clearly how to use the component, would be grateful for a proof-read and review.

stuart-clark-45 commented 6 years ago

@mjurczyk looks good to me

Sujeet1604 commented 6 years ago

@stuart-clark-45 , import { Ng4FilesModule } from 'angular4-files-upload'; worked like a charm . Thanks :)

gorakhwaghmode commented 6 years ago

I tried above code again there is a issue ./node_modules/angular4-files-upload/index.ts Module build failed: Error: D:\mean\demo-4\node_modules\angular4-files-upload\index.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv). at AngularCompilerPlugin.getCompiledFile (D:\mean\demo-4\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:674:23) at plugin.done.then (D:\mean\demo-4\node_modules\@ngtools\webpack\src\loader.js:467:39) at at process._tickCallback (internal/process/next_tick.js:188:7) @ ./src/app/app.module.ts 20:30-62 @ ./src/main.ts @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts

Please suggest me. Thank you.