Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISSUE: Doesn't honour the "max" count #198

Open
Manikkumar1988 opened this issue Apr 25, 2018 · 2 comments
Open

ISSUE: Doesn't honour the "max" count #198

Manikkumar1988 opened this issue Apr 25, 2018 · 2 comments

Comments

@Manikkumar1988
Copy link

In the html, configured
<image-upload url="http://example.com" [headers]="myHeaders" [max]="6" buttonCaption="Upload xxx Pictures" dropBoxMessage="" [extensions]="['jpeg','png']" (removed)="onRemoved($event)" (uploadFinished)="imageFinishedUploading($event)" (uploadStateChanged)="onUploadStateChanged($event)" [uploadedFiles]="imageUrl"></image-upload>

But the UI elements allow more than 6 images to be uploaded!

@Taylorsuk
Copy link

@Manikkumar1988 I've found this too. However, if I use 0 rather than 1 (the desired actual upload count) then it works. I wonder if this simply checks the .length of the uploaded image array, meaning it counts one less.

Either way, if I use the [max] operator I get the following nativeElement error. Have you found this?

TypeError: Cannot read property 'nativeElement' of undefined
    at ImageUploadComponent.push../node_modules/angular2-image-upload/lib/image-upload/image-upload.component.js.ImageUploadComponent.deleteFile (image-upload.component.js:91)
    at Object.eval [as handleEvent] (ImageUploadComponent.html:49)
    at handleEvent (core.js:9953)
    at callWithDebugContext (core.js:11046)
    at Object.debugHandleEvent [as handleEvent] (core.js:10749)
    at dispatchEvent (core.js:7415)
    at core.js:7859
    at HTMLDivElement.<anonymous> (platform-browser.js:1140)
    at HTMLDivElement.i (<anonymous>:1:158173)
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)
    at Object.onInvokeTask (core.js:3662)
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188)
    at ZoneTask.push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask [as invoke] (zone.js:496)
    at invokeTask (zone.js:1540)
    at HTMLDivElement.globalZoneAwareCallback (zone.js:1566)

@Manikkumar1988
Copy link
Author

I didnt face the issue you face! For now I handled upload count logic on my own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants