Skip to content

Commit eb51e48

Browse files
committed
Release 8.2.2
1 parent 5099ace commit eb51e48

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

README.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
</p>
3939
<h1 align="center">
4040
Get Started —
41-
<a href="https://stackblitz.com/edit/angular-upload-widget">
41+
<a href="https://stackblitz.com/edit/angular-upload-widget?file=src%2Fapp%2Fapp.component.ts">
4242
Try on StackBlitz
4343
</a>
4444
</h1>
@@ -99,7 +99,7 @@ export class AppModule {}
9999

100100
Choose one of these options:
101101

102-
### Option 1: Use the `uploadButton` directive
102+
### Option 1: Create an Upload Button — [Try on StackBlitz](https://stackblitz.com/edit/angular-upload-widget?file=src%2Fapp%2Fapp.component.ts)
103103

104104
The `uploadButton` directive displays a file upload modal on click.
105105

@@ -110,34 +110,38 @@ Inputs:
110110
- `uploadComplete` (optional): a callback containing a single parameter — an array of uploaded files.
111111

112112
```typescript
113-
import { Component } from "@angular/core";
114-
import { Uploader, UploadWidgetConfig, UploadWidgetResult } from "uploader";
113+
import { Component } from '@angular/core';
114+
import { Uploader, UploadWidgetConfig, UploadWidgetResult } from 'uploader';
115115

116116
@Component({
117-
selector: "app-root",
117+
selector: 'app-root',
118118
template: `
119-
<button uploadButton
120-
[uploader]="uploader"
121-
[uploadOptions]="options"
122-
[uploadComplete]="onComplete">
119+
<a href="{{ uploadedFileUrl }}" target="_blank">{{ uploadedFileUrl }}</a>
120+
<button
121+
uploadButton
122+
[uploadComplete]="onComplete"
123+
[uploadOptions]="options"
124+
[uploader]="uploader"
125+
>
123126
Upload a file...
124127
</button>
125-
`
128+
`,
126129
})
127130
export class AppComponent {
128-
uploader = Uploader({
129-
apiKey: "free"
131+
uploader = Uploader({
132+
apiKey: 'free', // <-- Get production-ready API keys from Upload.io
130133
});
131134
options: UploadWidgetConfig = {
132-
multi: false
135+
multi: false,
133136
};
134137
onComplete = (files: UploadWidgetResult[]) => {
135-
alert(files.map(x => x.fileUrl).join("\n"));
138+
this.uploadedFileUrl = files[0]?.fileUrl;
136139
};
140+
uploadedFileUrl = undefined;
137141
}
138142
```
139143

140-
### Option 2: Use the `upload-dropzone` component
144+
### Option 2: Create a Dropzone — [Try on StackBlitz](https://stackblitz.com/edit/angular-upload-dropzone?file=src%2Fapp%2Fapp.component.ts)
141145

142146
The `upload-dropzone` component renders an inline drag-and-drop file uploader.
143147

projects/angular-uploader/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-uploader",
3-
"version": "8.2.1",
3+
"version": "8.2.2",
44
"author": "Upload <[email protected]> (https://upload.io)",
55
"description": "Angular File Upload UI Widget — Lightweight & supports: drag and drop, multiple uploads, image cropping, customization & more 🚀 Comes with Cloud Storage 🌐",
66
"license": "MIT",

0 commit comments

Comments
 (0)