1<label class="image-upload-container btn btn-bwm">
2 <span>Select Image</span>
3 <input #imageInput
4 type="file"
5 accept="image/*"
6 (change)="processFile(imageInput)">
7</label>
1postFile(fileToUpload: File): Observable<boolean> {
2 const endpoint = 'your-destination-url';
3 const formData: FormData = new FormData();
4 formData.append('fileKey', fileToUpload, fileToUpload.name);
5 return this.httpClient
6 .post(endpoint, formData, { headers: yourHeadersConfig })
7 .map(() => { return true; })
8 .catch((e) => this.handleError(e));
9}