parent component class
export class Parent {
display: boolean = false;
constructor() { }
displayChildComponent() {
this.display = true;
}
}
parent component template
<child [isVisible]="display"></child>
child component class
export class Child {
@Input isVisible: boolean = false;
constructor() { }
onClick() {
this.isVisible = false;
}
}
When I trigger onClick() in the child component, the displayChildComponent() does not work to show the child component.
Why is that?