I have a list of buttons, when pressed, they will have a corresponding component that will get rendered.
<h3 class="first">Parent</h3>
<p-selectButton
[options]="metrics"
[(ngModel)]="selectedMetric"
(onChange)="onChange($event)"
></p-selectButton>
<div *ngIf="selectedMetric ==='Metric 1'">
Selected {{selectedMetric}}
<c1></c1>
</div>
<div *ngIf="selectedMetric ==='Metric 2'">
Selected {{selectedMetric}}
<c2></c2>
</div>
I need to set a component specific when c1 or c2 is shown. when selectedMetric is 'Metric 1", I need to set
active flag for component c1 to true and c2 active flag should be false.
Is there an event I can use for c1 and c2 for "show" "hide" that I can use to set the active flag there?
What is the recommended way of doing this?