@nova-ui/charts 12.0.17 → 12.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1088,10 +1088,20 @@
1088
1088
  this.chartComponent = chartComponent;
1089
1089
  this.chartCollectionService = chartCollectionService;
1090
1090
  }
1091
- ChartCollectionIdDirective.prototype.ngAfterViewInit = function () {
1092
- this.chartCollectionService
1093
- .getChartCollection(this.collectionId)
1094
- .addChart(this.chartComponent.chart);
1091
+ ChartCollectionIdDirective.prototype.ngOnChanges = function (changes) {
1092
+ var collectionIdChange = changes.collectionId;
1093
+ if (collectionIdChange) {
1094
+ if (collectionIdChange.previousValue) {
1095
+ this.chartCollectionService
1096
+ .getChartCollection(collectionIdChange.previousValue)
1097
+ .removeChart(this.chartComponent.chart);
1098
+ }
1099
+ if (collectionIdChange.currentValue) {
1100
+ this.chartCollectionService
1101
+ .getChartCollection(collectionIdChange.currentValue)
1102
+ .addChart(this.chartComponent.chart);
1103
+ }
1104
+ }
1095
1105
  };
1096
1106
  return ChartCollectionIdDirective;
1097
1107
  }());