Angular 2 | How to handle input type file in FormControl?

后端 未结 2 1685
孤街浪徒
孤街浪徒 2021-02-06 10:06

Good day,

How can i handle input type file in formControl? im using reactive form but when i get the value of my form it returns null value on my

2条回答
  •  粉色の甜心
    2021-02-06 11:05

    there is no way to handle this in angular form-control. we can provide some hack to make this work if you want to upload the image. just add the as form control on which user can add the file and acter grabbing the file we can change it to the base64code and then assign that value to the hidden field of our main form. then we can store the image file in that way.

    else you can go for the ng-file-upload moduleng file upload

提交回复
热议问题