I hope that's simple question, but I stuck a little bit. I have the next structure:
Component A
<ng-template [ngIf]="flaggedRecords">
...
<button (click)="showComparisonWindow(pi);">MERGE RECORDS</button>
...
</ng-template>
<ng-container *ngIf="showMergeCompare">
<app-component-B></app-component-B>
</ng-container>
Component B
<div>
...
<li><button type="button" (click)="closeMerge()"></button><li>
...
</biv>
I have Component A with a list of entries and buttons that should hide the view of Component A and display the content of Component B. Component B has an X-button that should close Component B and show Component A again.
I described in the component-A.ts
public showComparisonWindow(pi: number) {
this.showMergeCompare = !this.showMergeCompare;
this.flaggedRecords = !this.flaggedRecords;
}
That works for me!
BUT if I do the same for closeMerge() in the component-B.ts:
public closeMerge() {
this.showMergeCompare = !this.showMergeCompare;
this.flaggedRecords = !this.flaggedRecords;
}
That doesn't work. No errors, just happened nothing. Logically that should toggle the view, but that doesn't.
How to make it live? Thank you in advance!