You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| multiple : boolean | Set it as " true " for uploading multiple files at a time and as " false " for single file at a time. | false |
149
-
| formatsAllowed : string | Specify the formats of file you want to upload. | '.jpg,.png,.pdf,.docx, .txt,.gif,.jpeg' |
150
-
| maxSize : number | Maximum size limit for files in MB. | 20 MB |
151
-
| uploadAPI : string | Complete api url to which you want to upload. | undefined |
152
-
| ApiResponse:EventEmitter| It will return the response it gets back from the uploadAPI. Assign one custom function ,for example " DocUpload($event) " here, where " $event " will contain the response from the api. ||
153
-
| resetUpload : boolean | Give it's value as " true " whenever you want to clear the list of uploads being displayed. It's better to assign one boolean variable ('resetVar' here)to it and then change that variable's value. Remember to change 'resetVar' value 'true' to 'false' after every reset. | false |
154
-
| hideProgressBar : boolean | Set it as " true " to hide the Progress bar. | false |
155
-
156
-
You have seen that by using 'resetUpload' property, you can reset the module easily, however if you need to reset more than one time, there's a better way of doing that( bcoz in 'resetUpload' property, you have to make it as false in order to use it again):-
157
-
158
-
##### Example-3
159
-
```html
160
-
<angular-file-uploader#fileUpload1
161
-
[multiple]="true"
162
-
[formatsAllowed]="'.jpg,.png'"
163
-
[maxSize]="5"
164
-
[uploadAPI]="'https://example-file-upload-api'"
165
-
[resetUpload]=resetVar
166
-
(ApiResponse)="DocUpload($event)"
167
-
[hideProgressBar]="false">
168
-
</angular-file-uploader>
169
-
```
170
-
- Assign one local reference variable (here 'fileUpload1') to the component.
171
-
- Now use this local reference variable in your xyz.component.ts file.
172
-
```javascript
173
-
@ViewChild('fileUpload1')
174
-
private fileUpload1: FileUploadComponent;
175
-
```
176
-
- Remember to import ViewChild and FileUploadComponent properly in your component.
177
-
```javascript
178
-
import { ViewChild } from '@angular/core';
179
-
import { FileUploadComponent } from "angular-file-uploader";
0 commit comments