Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

206
Vistas
angular 2 : multiple use of one component in parent component

I have CarsComponent that I multi time use ChartComponent in it's template as I mentioned in code snippet:

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>

and and in my ChartComponent I use 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 problem is when report-chart load in cars-component selected radio button only show in one instance and I want to prevent affection of two instance to each other

enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If I understand correctly you want to enable the ratio buttons only in the second child component and not the first.

The solution would be to pass a boolean input in the child component to show or not the ratio button.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda