I'm using Angular 4.3.3. I'd like to know how I can hide a `<div>` if user clicks on remove link, and if request succeeds, so remove it, elseif request failed, so show element again.

This is the typescript code of remove:

```
import {HttpClient, HttpErrorResponse, HttpHeaders} from '@angular/common/http';

...

    constructor(private http: HttpClient, private globals: Globals, private activatedRoute: ActivatedRoute) { }

    deleteComment(url, index) {
        this.http.delete(url).subscribe(
        res => {
            console.log('success');
        },
        err => {
            console.log('Error occured.');
        });
    }

```

And this is the HTML:

```
<div *ngFor="let comment of result?.comments; let i = index">
    <a (click)="deleteComment(comment?._links.delete.href, i)">remove {{comment?.id}}</a>

    <div class="media-body">
        <small>{{comment?.createdAt|date:'shortDate'}}</small>
        <p>{{comment?.content}}</p>
    </div>  
</div>

```