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
| config : object | It's a javascript object. Use this to add custom constraints to the module. All available key-value pairs are given in example 2.For detailed decription refer the table below. | {} |
59
+
| 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. ||
60
+
| 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 |
| multiple : boolean | Set it as " true " for uploading multiple files at a time and as " false " for single file at a time. | false |
66
+
| formatsAllowed : string | Specify the formats of file you want to upload. | '.jpg,.png,.pdf,.docx, .txt,.gif,.jpeg' |
67
+
| maxSize : number | Maximum size limit for files in MB. | 20 MB |
68
+
| uploadAPI : string | Complete api url to which you want to upload. | undefined |
69
+
| 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. ||
70
+
| 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 |
71
+
| hideProgressBar : boolean | Set it as " true " to hide the Progress bar. | false |
72
+
73
+
---
74
+
##### A Better Way to reset the module
75
+
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):-
76
+
77
+
###### Example-3
78
+
```html
79
+
<angular-file-uploader#fileUpload1
80
+
[config]="afuConfig"
81
+
[resetUpload]=resetVar
82
+
(ApiResponse)="DocUpload($event)">
83
+
</angular-file-uploader>
84
+
```
85
+
- Assign one local reference variable (here 'fileUpload1') to the component.
86
+
- Now use this local reference variable in your xyz.component.ts file.
87
+
```javascript
88
+
@ViewChild('fileUpload1')
89
+
private fileUpload1: FileUploadComponent;
90
+
```
91
+
- Remember to import ViewChild and FileUploadComponent properly in your component.
92
+
```javascript
93
+
import { ViewChild } from '@angular/core';
94
+
import { FileUploadComponent } from "angular-file-uploader";
95
+
```
96
+
- That's it.....all done, now just use
97
+
```javascript
98
+
this.fileUpload1.resetFileUpload();
99
+
```
100
+
to reset the module hassle-free anytime.
101
+
102
+
#####Points to note:
103
+
- Files are uploaded in FormData format.
104
+
105
+
###Coming Soon:
106
+
- Multiple themes.
107
+
- Drag n Drop.
108
+
- More customization options.
109
+
110
+
#### For Versions < 2.x :
27
111
#####Example-1
28
112
```html
29
113
<angular-file-uploader
@@ -85,9 +169,4 @@ You have seen that by using 'resetUpload' property, you can reset the module eas
0 commit comments