1)编辑html的时间代码:-
<div class="form-group col-md-4">
<label class="label-control" for="profileofdoctor">Select Profile:
</label>
<label id="projectinput8" class="file center-block">
<input type="file" id="profileofdoctor" name="profileofdoctor"
[(ngModel)]="doctor.profileofdoctor" #profileofdoctor="ngModel"/>
<span class="file-custom"></span>
</label>
</div>
2) component file to edit all value:-
showEditDoctor(doctor:any):void
{
this.doctorToEdit = doctor;
this.apiMessage = "";
}
EditDoctor(doctor:any):void
{
if(!doctor){ return; }
doctor.id = this.doctorToEdit._id;
this.doctorsService.updateDoctors(doctor)
.then(td => {
const updateDoctors = this.doctors.map(t => {
if(td.doctor._id !== t._id){
return t;
}
return { ...t, ...td.doctor };
})
this.apiMessage = td.message;
this.doctors = updateDoctors;
})
}
我正在尝试在angular js 4的编辑时间内输入文件取值,但是我没有获取文件取值,请给我帮助!!!!
我使用MEAN js开发了一个凝结操作,并且我创建了一个医生模块,每当我单击“编辑”按钮并在文本框中获取值时,大多数值都会显示,但输入文件的值不会显示并给我错误