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?





-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to