Created
March 10, 2018 06:00
-
-
Save rahulsahay19/2ba4e4f241d4604c12afd36d78792e82 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
newRequest() { | |
const request = new HttpRequest( | |
"POST", "/api/progress-request", {}, | |
{reportProgress: true}); | |
this.http.request(request) | |
.subscribe( | |
event => { | |
if (event.type === HttpEventType.DownloadProgress) { | |
console.log("Download progress", event); | |
} | |
if (event.type === HttpEventType.UploadProgress) { | |
console.log("Upload progress", event); | |
} | |
if (event.type === HttpEventType.Response) { | |
console.log("Response received", event.body); | |
} | |
} | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment