Angular 我想将下拉列表绑定到上载
我通过API上传到服务器,但我需要发送带有特定标题的数据,应该从下拉列表中选择 在.html文件中Angular 我想将下拉列表绑定到上载,angular,typescript,Angular,Typescript,我通过API上传到服务器,但我需要发送带有特定标题的数据,应该从下拉列表中选择 在.html文件中 <input type="file" style="display: none" #upLoad (change)= "onFileSelected($event)"> button type="button" (click)="upLoad.click()">PDF Upload</button> button type=“button”(单击)=“上载。单
<input type="file" style="display: none" #upLoad (change)= "onFileSelected($event)">
button type="button" (click)="upLoad.click()">PDF Upload</button>
button type=“button”(单击)=“上载。单击()”>PDF上载
下拉列表
bertrieb
heizen
all
在.ts文件中
选举(事件){
this.selectedFile=event.target.files[0];
console.log(事件);
const fd=new FormData();
fd.append('files',this.selectedFile,this.selectedFile.name);
这个.zeitraumeService.uploadFile(fd).subscribe(res=>{
控制台日志(res);
})将另一个属性添加到formData
fd.append('dropdownDetails', details);
下拉代码在哪里?bertrieb heizen所有这些都是我的下拉值,我可以用fd.append('dropdownDetails',selected)发送它;我猜是的。从后端使用
dropdownDetails
key找到所选的值。我用下拉代码编辑,你能检查一下吗
fd.append('dropdownDetails', details);