Skip to content

Commit

Permalink
chore(demo): update demo to 4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jkuri committed Sep 28, 2017
1 parent cfc7e3d commit 77cae6e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/components/app-home/app-home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ <h1>My Uploads</h1>
</div>
</div>

<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>
<p>
<span>your files here or</span>
<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>
browse
</label>
</p>
Expand Down
11 changes: 6 additions & 5 deletions src/components/app-home/app-home.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, EventEmitter } from '@angular/core';
import { UploadOutput, UploadInput, UploadFile, humanizeBytes } from '../../../';
import { UploadOutput, UploadInput, UploadFile, humanizeBytes, UploaderOptions } from '../../../';

interface FormData {
concurrency: number;
Expand All @@ -17,8 +17,11 @@ export class AppHomeComponent {
uploadInput: EventEmitter<UploadInput>;
humanizeBytes: Function;
dragOver: boolean;
options: UploaderOptions;

constructor() {
this.options = { concurrency: 1 };

this.formData = {
concurrency: 1,
autoUpload: false,
Expand All @@ -38,8 +41,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 @@ -64,8 +66,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 Down

0 comments on commit 77cae6e

Please sign in to comment.