Created
March 5, 2019 10:37
-
-
Save wKoza/48b04a7804d48c8c828e0e0aa33fd8de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnInit } from '@angular/core'; | |
import { FileItem, HttpClientUploadService } from '@wkoza/ngx-upload'; | |
@Component({ | |
selector: 'app-root', | |
templateUrl: './simple.component.html', | |
styleUrls: ['./simple.component.css'] | |
}) | |
export class SimpleBootstrapComponent implements OnInit { | |
constructor(public uploader: HttpClientUploadService) { } | |
ngOnInit() { | |
this.uploader.onCancel$.subscribe( | |
(data: FileItem) => { | |
console.log('file deleted: ' + data.file); | |
}); | |
this.uploader.onProgress$.subscribe( | |
(data: any) => { | |
console.log('upload file in progree: ' + data.progress); | |
}); | |
this.uploader.onSuccess$.subscribe( | |
(data: any) => { | |
console.log(`upload file successful: ${data.item} ${data.body} ${data.status} ${data.headers}`); | |
} | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment