Inside the code, I create an input element with the file type. I don't add it to the tree. I want to get the value of this input after the user adds it to the file. There is one, but I do not need to add this input to the HTML template.
<p-splitButton
label="Add document"
icon="pi pi-plus"
(onClick)="openAddDocument()"
[model]="addDocumentButtonMenuItems"
styleClass="p-button-help"
></p-splitButton>
public readonly addDocumentButtonMenuItems = [
{
label: 'Dowload document', icon: 'pi pi-upload', command: () => {
this.uploadFile();
},
},
];
public uploadFile(): void {
const input = document.createElement('input');
input.type = 'file';
input.click();
}
How to get value input?