How to use input type file in angular material

后端 未结 4 1314
萌比男神i
萌比男神i 2021-02-01 02:50

How to use input type file in angular material

Hi, I am using angular material for designing. when i go on angular material site there no input type fil

4条回答
  •  你的背包
    2021-02-01 03:25

    Angular Material does not support yet a workaround for file upload. There are alternative to archieve this. e.g using external libraries.

    angular-material-fileupload: link to npm package

    Supported features:

    • Drag and drop
    • common uploads
    • progress bar
    • file size and more...

    ngx-material-file-input: Link to repository

    Supported features:

    • ngx-mat-file-input component, to use inside Angular Material mat-form-field
    • a FileValidator with maxContentSize, to limit the file size
    • a ByteFormatPipe to format the file size in a human-readable format
    • and more small minor features...

    Update

    See the answer here if you just need a workaround without external library https://stackoverflow.com/a/53546417/6432698

提交回复
热议问题