I'm using Angular 13 with PrimeNG. I have this file upload component
<form [formGroup]="form" >
...
<p-fileUpload [customUpload]="true" (uploadHandler)="uploadFile($event)" [multiple]="false" formControlName="myFile"></p-fileUpload>
How do I bind this to my form's form control? I have this in my service file
form: FormGroup;
...
this.form = this.fb.group({
...
myFile: [null],
});
save(){
...
const formData = new FormData();
const myObject = this.form.value;
...
console.log("file:" + myObject.myFile);
but even when I upload a file, I repeatedly see "file: null" output and no file is bound to my form control. What's the proper way to bind my p-fileupload value to a form control?