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

Fixed issue with filter of undefined when using an <input type="file"> #168

Merged
merged 3 commits into from
Dec 30, 2016

Conversation

eikster-dk
Copy link
Contributor

@eikster-dk eikster-dk commented Dec 30, 2016

As it returns a FileList instead of an array, instead i made use of the prototype.filter.call, which works perfectly in this situation where you use both the dropzone and the file input type :)

fixes #164

As it returns a FileList instead of an array.. but its possible to use array functions
@@ -35,7 +35,7 @@ export class NgFileDropDirective implements OnChanges, OnInit {
this.uploader._emitter.subscribe((data: any) => {
this.onUpload.emit(data);
if (data.done && this.files && this.files.length) {
this.files = this.files.filter(f => f.name !== data.originalName);
this.files = Array.prototype.filter.call(this.files, (x: any) => x.name !== data.originalName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, here's the catch. can you please update to [].filter.call.. and bump version in package.json so I can publish it to npm. Thanks.

@jkuri
Copy link
Contributor

jkuri commented Dec 30, 2016

Thanks, merging..

@eikster-dk
Copy link
Contributor Author

There you go mate :)

@jkuri jkuri merged commit 4770760 into bleenco:master Dec 30, 2016
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

Successfully merging this pull request may close these issues.

Everything working fine, but this error message: ... what does it mean?
2 participants