ng2FileSelect clearing text after upload/cancel #744
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi there,
I think it would be good idea to have an option to clear the text after successful upload.
Please excuse my poor knowledge of the matter but i did not find a nice way of doing it other way.
I would expose a method with this.element.nativeElement.value = '';
Or maybe some listener
+1
+1
removeAfterUpload ?
It doesn't work.. It clears the queue but the text remains in the input control. Any suggestions? The only thing I've been able to get to work is a reset button. Calling resetForm from a method within the component doesn't even seem to work. I'm a little stumped.
@davidjconnolly
Not Sure if it's the same case i had, but if it's about the view not updating it self or not in sync (no data binding)
try this fix:
definitions:
import {ChangeDetectorRef} from "angular/core"
constructor(private detector: ChangeDetectorRef){}
and after removeAfterupdate line :
this.detector.detectChanges();
Thanks @jodevsa, I tried this.detctor.detectChanges() after calling .upload but it didn't work. removeAfterUpload is a property on the uploader library not something that you're able to call I don't think.
I have a complete hack workaround in the meantime until I can figure out how to fix it properly:
@davidjconnolly Can you share the button code as well please?
Hey @Ondrazar ya sorry here's my code:
component.ts:
component.html: