Skip to content

Commit

Permalink
Step 21.21: Use the upload function
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha authored and DAB0mB committed Dec 14, 2016
1 parent aa6448c commit 7f4a6a1
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion client/imports/app/parties/parties-upload.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ import { Component } from '@angular/core';

import template from './parties-upload.component.html';

import { upload } from '../../../../both/methods/images.methods';

@Component({
selector: 'parties-upload',
template
})
export class PartiesUploadComponent {
fileIsOver: boolean = false;
uploading: boolean = false;

constructor() {}

Expand All @@ -16,6 +19,15 @@ export class PartiesUploadComponent {
}

onFileDrop(file: File): void {
console.log('Got file');
this.uploading = true;

upload(file)
.then(() => {
this.uploading = false;
})
.catch((error) => {
this.uploading = false;
console.log(`Something went wrong!`, error);
});
}
}

0 comments on commit 7f4a6a1

Please sign in to comment.