I wanted to keep the image upload feature simple. So, along with the existing reply with text features, we are going to add another button named Reply with Image. This button will launch a modal and help us with the upload process. Open client\app\view-thread\view-thread.component.html and next to the Reply button at the bottom of the page, add the following code:
// SNIPP SNIPP<div class="col text-center"> <button class="btn btn-info" type="submit" (click)="uploadImage(thread)"><i class="fa fa-user-plus"></i> Reply with Image</button> </div>// SNIPP SNIPP
Next, the required logic for uploadImage will be placed in client\app\view-thread\view-thread.component.ts and should be as follows:
// SNIPP SNIPP