Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

212
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda