@nova-ui/charts 13.0.3-3965 → 13.0.3

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.
@@ -1471,14 +1471,26 @@ class ChartCollectionIdDirective {
1471
1471
  this.chartComponent = chartComponent;
1472
1472
  this.chartCollectionService = chartCollectionService;
1473
1473
  }
1474
- ngAfterViewInit() {
1475
- this.chartCollectionService
1476
- .getChartCollection(this.collectionId)
1477
- .addChart(this.chartComponent.chart);
1474
+ ngOnChanges(changes) {
1475
+ console.log("ngOnChanges");
1476
+ const collectionIdChange = changes.collectionId;
1477
+ if (collectionIdChange) {
1478
+ console.log("collectionIdChange", collectionIdChange);
1479
+ if (collectionIdChange.previousValue) {
1480
+ this.chartCollectionService
1481
+ .getChartCollection(collectionIdChange.previousValue)
1482
+ .removeChart(this.chartComponent.chart);
1483
+ }
1484
+ if (collectionIdChange.currentValue) {
1485
+ this.chartCollectionService
1486
+ .getChartCollection(collectionIdChange.currentValue)
1487
+ .addChart(this.chartComponent.chart);
1488
+ }
1489
+ }
1478
1490
  }
1479
1491
  }
1480
1492
  ChartCollectionIdDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ChartCollectionIdDirective, deps: [{ token: CHART_COMPONENT }, { token: ChartCollectionService }], target: i0.ɵɵFactoryTarget.Directive });
1481
- ChartCollectionIdDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ChartCollectionIdDirective, selector: "[nuiChartCollectionId]", inputs: { collectionId: ["nuiChartCollectionId", "collectionId"] }, ngImport: i0 });
1493
+ ChartCollectionIdDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ChartCollectionIdDirective, selector: "[nuiChartCollectionId]", inputs: { collectionId: ["nuiChartCollectionId", "collectionId"] }, usesOnChanges: true, ngImport: i0 });
1482
1494
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ChartCollectionIdDirective, decorators: [{
1483
1495
  type: Directive,
1484
1496
  args: [{