Skip to content

Commit

Permalink
docs(readme): update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jkuri committed Sep 28, 2017
1 parent 77cae6e commit eefdc5f
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ If you are looking for documentation for version prior to `3.0.0`, please check
1. Add `ngx-uploader` module as dependency to your project.

```
yarn add ngx-uploader
npm install ngx-uploader --save
```

2. Include `NgUploaderModule` into your main AppModule or in module where you will use it.
Expand Down Expand Up @@ -93,13 +93,14 @@ export interface UploadInput {

```ts
import { Component, EventEmitter } from '@angular/core';
import { UploadOutput, UploadInput, UploadFile, humanizeBytes } from 'ngx-uploader';
import { UploadOutput, UploadInput, UploadFile, humanizeBytes, UploaderOptions } from 'ngx-uploader';

@Component({
selector: 'app-home',
templateUrl: 'app-home.component.html'
})
export class AppHomeComponent {
options: UploaderOptions;
formData: FormData;
files: UploadFile[];
uploadInput: EventEmitter<UploadInput>;
Expand All @@ -119,8 +120,7 @@ export class AppHomeComponent {
// type: 'uploadAll',
// url: '/upload',
// method: 'POST',
// data: { foo: 'bar' },
// concurrency: 0
// data: { foo: 'bar' }
// };
// this.uploadInput.emit(event);
} else if (output.type === 'addedToQueue' && typeof output.file !== 'undefined') { // add file to array when added
Expand All @@ -146,8 +146,7 @@ export class AppHomeComponent {
type: 'uploadAll',
url: 'http://ngx-uploader.com/upload',
method: 'POST',
data: { foo: 'bar' },
concurrency: this.formData.concurrency
data: { foo: 'bar' }
};

this.uploadInput.emit(event);
Expand All @@ -172,12 +171,12 @@ export class AppHomeComponent {
For whole template code please check [here](https://github.com/jkuri/ngx-uploader/tree/master/src/app/components/app-home/app-home.component.html).

```html
<div class="drop-container" ngFileDrop (uploadOutput)="onUploadOutput($event)" [uploadInput]="uploadInput" [ngClass]="{ 'is-drop-over': dragOver }">
<div class="drop-container" ngFileDrop [options]="options" (uploadOutput)="onUploadOutput($event)" [uploadInput]="uploadInput" [ngClass]="{ 'is-drop-over': dragOver }">
<h1>Drag & Drop</h1>
</div>

<label class="upload-button">
<input type="file" ngFileSelect (uploadOutput)="onUploadOutput($event)" [uploadInput]="uploadInput" multiple>
<input type="file" ngFileSelect [options]="options" (uploadOutput)="onUploadOutput($event)" [uploadInput]="uploadInput" multiple>
or choose file(s)
</label>

Expand Down

0 comments on commit eefdc5f

Please sign in to comment.