'How to open a modal from a parent component and have the close action reset the parent component so that the modal can open again in angular

I have two components parent and child component . child component is a modal overlay(popup). In parent component on one click I have to open modal . till here I have done but once I close modal ,I'm not able to open modal again.

parent component html

<a (ckick)="openLearningPathPopup()"> click here </a>

<div id="learningPopup" *ngIf="showLearningPopup">
  <app-ds-emp-learning ></app-ds-emp-learning>
</div>


parent component ts part


showLearningPopup :boolean = false;

openLearningPathPopup(){ 
      this.showLearningPopup = true;
  }


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source