I am trying to implement an upload feature for my Apps using IONIC.
Below is the HTML code snippet I have written:
<input ion-button block type="file" id="uploadBR">
<input ion-button block type="file" id="uploadIC">
<button ion-button block (click)="upload()">Confirm Claim Restaurant</button>
This is the upload()
function that I have defined:
upload(){
let BR = document.getElementById('uploadBR').files[0]
let IC = document.getElementById('uploadIC').files[0]
console.log(BR)
console.log(IC)
}
The functionality seems to work in regular HTML, but it encounters issues with IONIC.
Upon building the App, an error message pops up saying
Typescript Error: Property 'files' does not exist on type 'HTMLElement'.
Could you please guide me on whether I am approaching this correctly or if I need to modify it while working with typescript?
Thank you.