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

Directive seems to not work when applied #3

Closed dannief closed 8 years ago

dannief commented 8 years ago

Hi. Found your component after searching for file drop that didn't require an upload URL. Unfortunately, I can't get it to work. I thought I would try running the samples but I am getting this error.

Running ' tsc -p tsconfig-ci.json'
Traceback (most recent call last):
  File "../automation/prepare_distribution_package.py", line 94, in <module>
    main()
  File "../automation/prepare_distribution_package.py", line 74, in main
    build_project()
  File "../automation/prepare_distribution_package.py", line 45, in build_project
    return_code, std_out, std_err = cli.run_command_line(config_root, "tsc", ['-p', 'tsconfig-ci.json'])
  File "C:\Dev\Code_Samples\ng2-file-drop\automation\cli.py", line 48, in run_command_line
    proc = subprocess.Popen(command_and_args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "C:\tools\python2\lib\subprocess.py", line 710, in __init__
    errread, errwrite)
  File "C:\tools\python2\lib\subprocess.py", line 958, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

I tried running npm start anyway and got this error:

src/app/app.module.ts(12,36): error TS2307: Cannot find module 'ng2-file-drop'.
src/app/components/file-drop-samples/disable-styles/disable-styles.component.ts(3,42): error TS2307: Cannot find module 'ng2-file-drop'.
src/app/components/file-drop-samples/image-validation/image-validation.component.ts(3,42): error TS2307: Cannot find module 'ng2-file-drop'.
src/app/components/file-drop-samples/size-validation/size-validation.component.ts(3,67): error TS2307: Cannot find module 'ng2-file-drop'.
9:45:57 PM - Compilation complete. Watching for file changes.

So I am pretty much stuck.

I am running on windows and have python2 in my path. In addition, I am using this in a project targeting angular 2.1.1 and angular-cli 1.0.0-beta.18.

I imported and exported the Ng2FileDropModule module in my SharedModule and have imported my SharedModule in the feature module that I am working on. This has worked with ng2-bootstrap and angular2-ladda, which I am also using.

The problem is that ng2FileDrop selector on my div seems to not have any effect.

I am applying it like this <div ng2FileDrop class="h4 ba b--dashed br3"></div>

Any help would be appreciated.

Thanks

dannief commented 8 years ago

So just after I wrote this I read the code and realized that I expected to see something visual on the screen indicating that drop zone was there :flushed:. Yeah. It's totally fine. I probably need some shut-eye or something. So I am closing this issue.

Thanks again for the component by the way. Saved me from integrating drop zone myself