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 committed Nov 27, 2016
1 parent 67b25f8 commit ecc0805
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion client/imports/app/parties/parties-upload.component.ts
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 ecc0805

Please sign in to comment.