I am new to Angular 6 development and I am looking for a solution for the following problem.
I tried to implement the following which loads with a condition (*ngIf = "showError")
<div *ngIf="showError" class="alert">
<span class="closebtn" onclick="this.parentElement.style.display='none';">×</span>
<strong>Alert </strong> Error occured when saving data.
</div>
Once it shows in the 1st time when I close this div
with a close button and then I proceed to generate the same error which means showError = true but from 2nd time onward I can't make this div visible due to this.parentElement.style.display='none'. How can I solve this to show this div each time showError = true
even after closing the div before?