Typescript 错误:http://localhost:8100/上载文件时[对象%20文件]
我的html表单如下所示:Typescript 错误:http://localhost:8100/上载文件时[对象%20文件],typescript,angular,Typescript,Angular,我的html表单如下所示: <input type="file" (change)="fileChangeEvent($event)" placeholder="Upload file" /> 这很好。当我单击输入字段并选择一个文件并将其分配给angular2 typescript应用程序中的一个变量时,控制台会报告一个错误 public base64Image: File; fileChangeEvent(fileInput: any){ this.base
<input type="file" (change)="fileChangeEvent($event)" placeholder="Upload file" />
这很好。当我单击输入字段并选择一个文件并将其分配给angular2 typescript应用程序中的一个变量时,控制台会报告一个错误
public base64Image: File;
fileChangeEvent(fileInput: any){
this.base64Image = fileInput.target.files[0]; <-- error reported here
}
public base64图像:文件;
fileChangeEvent(fileInput:any){
this.base64Image=fileInput.target.files[0];