I have a CarsComponent where I repeatedly use the ChartComponent in its template, as shown in the code snippet below:
cars.component.html:
<div class="row" *ngIf="selectedItemId">
<div class="col-12 mb-2">
<report-chart [LegendData]="xAxisData1"
[SeriesData]="yAxisData1"
title="میزان خروج وسیله ی نقلیه از مراکز تولید"
barChartColor="#ad106c"
(onReportClick)="getProductReport()">
</report-chart>
</div>
<div class="col-12">
<report-chart [LegendData]="xAxisData2"
[SeriesData]="yAxisData2"
barChartColor="#3398DB"
title="میزان ورود وسیله نقلیه به مراکز فروش"
(onReportClick)="getSaleReport()">
</report-chart>
</div>
</div>
Additionally, in my ChartComponent, I have implemented a radio-button-group like this:
chart.component.html:
<nb-radio-group [(ngModel)]="selectedChart" class="d-flex justify-content-center">
<nb-radio class="d-flex justify-content-center"
*ngFor="let option of radioButtonsOptions"
[value]="option.value">
{{ option.label }}
</nb-radio>
</nb-radio-group>
My issue is that when the report-chart loads in the cars-component, the selected radio button only shows in one instance, and I want to prevent the two instances from affecting each other.