From 9e3dae15b3226d80c2f631a9aeb91337ca5cd97a Mon Sep 17 00:00:00 2001 From: Aviad Pineles Date: Wed, 20 Mar 2019 15:23:04 +0200 Subject: [PATCH] fix: Add Label to chart config exports --- .../files/app-chart-config.ts.template | 1 + .../src/ng2-charts-schematics/ng2-charts-line.ts | 1 - projects/ng2-charts/package.json | 2 +- src/app/app-chart-config.ts | 1 + src/app/line-chart/line-chart.component.ts | 10 ++++++++-- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ng2-charts-schematics/src/ng2-charts-schematics/files/app-chart-config.ts.template b/ng2-charts-schematics/src/ng2-charts-schematics/files/app-chart-config.ts.template index a32dedc6..0783a08d 100644 --- a/ng2-charts-schematics/src/ng2-charts-schematics/files/app-chart-config.ts.template +++ b/ng2-charts-schematics/src/ng2-charts-schematics/files/app-chart-config.ts.template @@ -26,6 +26,7 @@ export { ScaleUnion, ThemeService, BaseChartDirective, + Label, } from 'ng2-charts'; export type AngularChart = ng2Charts.AngularChart; diff --git a/ng2-charts-schematics/src/ng2-charts-schematics/ng2-charts-line.ts b/ng2-charts-schematics/src/ng2-charts-schematics/ng2-charts-line.ts index 0a9ea72a..ea19c864 100644 --- a/ng2-charts-schematics/src/ng2-charts-schematics/ng2-charts-line.ts +++ b/ng2-charts-schematics/src/ng2-charts-schematics/ng2-charts-line.ts @@ -47,7 +47,6 @@ export function ng2ChartsLine(_options: any): Rule { return chain([ externalSchematic('@schematics/angular', 'component', _options), buildMetaConfig(_options), - buildMetaConfig(_options), ng2ProcessTree(_options, newCode, newMarkup, newImports), ]); } diff --git a/projects/ng2-charts/package.json b/projects/ng2-charts/package.json index e8a5b6ce..17dc82bf 100644 --- a/projects/ng2-charts/package.json +++ b/projects/ng2-charts/package.json @@ -1,6 +1,6 @@ { "name": "ng2-charts", - "version": "3.0.0-beta.1", + "version": "3.0.0-beta.2", "peerDependencies": { "@angular/common": "^7.2.0", "@angular/core": "^7.2.0", diff --git a/src/app/app-chart-config.ts b/src/app/app-chart-config.ts index 84f62b59..faf456da 100644 --- a/src/app/app-chart-config.ts +++ b/src/app/app-chart-config.ts @@ -22,6 +22,7 @@ export { ScaleUnion, ThemeService, BaseChartDirective, + Label, } from 'ng2-charts'; export type AngularChart = ng2Charts.AngularChart; diff --git a/src/app/line-chart/line-chart.component.ts b/src/app/line-chart/line-chart.component.ts index 5193c06b..31954285 100644 --- a/src/app/line-chart/line-chart.component.ts +++ b/src/app/line-chart/line-chart.component.ts @@ -1,7 +1,13 @@ import { Component, OnInit, ViewChild } from '@angular/core'; -import { Color, Label, BaseChartDirective } from 'ng2-charts'; import * as pluginAnnotations from 'chartjs-plugin-annotation'; -import { AppChartMetaConfig, ChartDataSetsLine, ChartOptions } from '../app-chart-config'; +import { + AppChartMetaConfig, + ChartDataSetsLine, + ChartOptions, + Color, + Label, + BaseChartDirective +} from '../app-chart-config'; @Component({ selector: 'app-line-chart',