I have multiple tabs view with a component rendering in each one of them. Here is the code for that:
<mat-tab-group>
<mat-tab *ngFor="let g of goals; index as i">
<ng-template mat-tab-label>{{g.name}}</ng-template>
<div class="row">
<app-summary [goal]="g"></app-summary>
</div>
<div class="row">
<mat-table #table [dataSource]="dataSource[i]">
## some table content here
</mat-table>
</div>
</mat-tab>
</mat-tab-group>
Here is what app-summary
looks like:
<div fxLayout="column" fxLayoutGap="20px" style="padding: 20px; width: 1100px;">
<div fxLayout="row" fxLayoutGap="10px" fxLayoutAlign="start start">
<div fxFlex="55">
<mat-card class="summary-card">
<mat-card-content>
<chart [options]="wealthOptions"></chart>
</mat-card-content>
</mat-card>
</div>
<div fxFlex="25">
<mat-card class="summary-card">
<mat-card-content>
<chart [options]="pieProbOptions"></chart>
</mat-card-content>
</mat-card>
</div>
</div>
</div>
The <chart>
contains highchart views. However, the charts are available only for the first tab. The component
is loaded and rendered for each tab.
Is there something missing here or needs to be done is certain way?