reset image input on discarding form changes- Angular
I have a form with an image input and want to reset the whole form along with image input.
Right now the image input does not reset it stays as the one I uploaded latest.
The image is not saved to DB right now.
Replies (3)
Hi,
Can you please provide more info or code sample ? Which component are you using for the image input ?
Regards.
I am using keenthemes image input control. Mentioned below.
https://preview.keenthemes.com/metronic/demo2/rtl/crud/file-upload/image-input.html
Hi,
Can you try to use below to remove or cancel the image input attachment:
var input = document.querySelector('#kt_image_4');
input.querySelector('[data-action="cancel"]').click();
input.querySelector('[data-action="remove"]').click();
For more info please check the component source code in src/js/components/image-input.js
Regards.