media.html
<form #form="ngForm" (ngSubmit)="uploadFile(form.value)">
<input type="file" ngControl="inputFile" />
<input type="text" ngControl="name"/>
<button type="submit" >Upload</button>
</form>
media.ts
uploadFile(fileUpload){
console.log(fileUpload); // this
this.mediaService.addMedia(fileUpload).subscribe((r)=> {
console.log(r);
},
(error) => {
console.log(error.text());
}
);
}
in line : console.log("fileUpload"); . It print out that :
inputFile:null
name: "asdasdasdasd"
this mean that I can't catch value of to submit on my server . how to catch it ? thanks for help !