Open autengu opened 4 years ago
Hi! Thanks for reporting this issue. I will try to reproduce this situation.
Any update on this?
on fileReset() method, the variable this.myInputFile get always null
**Hi there,
@kolkov , first of all, thank you for this editor.
I am still having that issue mentiuoned here. I paste the oputput I am getting in case it helps.
ERROR TypeError: Cannot read property 'nativeElement' of undefined
at AngularEditorToolbarComponent.push../node_modules/@kolkov/angular-editor/fesm5/kolkov-angular-editor.js.AngularEditorToolbarComponent.fileReset (kolkov-angular-editor.js:1145)
at SafeSubscriber._next (kolkov-angular-editor.js:1113)
at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub (Subscriber.js:192)
at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next (Subscriber.js:130)
at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next (Subscriber.js:76)
at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:53)
at MergeMapSubscriber.push../node_modules/rxjs/_esm5/internal/operators/mergeMap.js.MergeMapSubscriber.notifyNext (mergeMap.js:87)
at InnerSubscriber.push../node_modules/rxjs/_esm5/internal/InnerSubscriber.js.InnerSubscriber._next (InnerSubscriber.js:15)
at InnerSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:53)
at FinallySubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next (Subscriber.js:76)**
Thanks,
Getting the same issue here.
same issue too
Until new release to fix this issue: goto node_modules/@kolkov/angular-editor/__ivy_ngcc__/fesm2015/kolkov-angular-editor.js and do the followings:
if (e instanceof HttpResponse) { this.editorService.insertImage(e.body.imageUrl); // this.fileReset(); //comment out his line event.srcElement.value = null; // add this line } //comment this section of the code // /* // Reset Input // @return {?} // / // fileReset() { // this.myInputFile.nativeElement.value = ''; // }
Hi,
I get following error when I succesfully upload an image:
ERROR TypeError: Cannot read property 'nativeElement' of undefined at AngularEditorToolbarComponent.fileReset (angular-editor-toolbar.component.ts:339)
The problem is that myInputFile is always (ViewChild: fileInput) undefined.
So here:
` onFileChanged(event) { /* @type {?} / const file = event.target.files[0]; if (file.type.includes('image/')) { if (this.uploadUrl) { this.editorService.uploadImage(file).subscribe((/**
when calling:
fileReset() { this.myInputFile.nativeElement.value = ''; }
myInputFile does not exist.