I am trying to add a class to an element in a child component when a button is clicked in the parent component.
For this I have a button in the parent component to change a variable --
<button type="button" (click)="showModal=true">clicky</button>
and in the child a modal with a directive? to add class when the variable is true.
<div class="modal" [ngClass]="{'show': showModal}"
id="exampleModal" tabindex="-1" role="dialog">
If I move the html for the modal to the parent component everything works. What is the easiest way of passing the variable to the child component?