import { NgModule, ModuleWithProviders, InjectionToken } from '@angular/core'; import { CosmosChartService } from './common/chart.service'; import { CosmosChartModule } from './cm-chart/chart.module'; import { CosmosPieModule } from './cm-pie/pie.module'; import { CosmosBarModule } from './cm-bar/bar.module'; import { CosmosRadarModule } from './cm-radar/radar.module'; import { CosmosFunnelModule } from './cm-funnel/funnel.module'; import { CosmosScatterModule } from './cm-scatter/scatter.module'; import { CosmosStitchesModule } from './cm-stitches/stitches.module'; // 导出组件模块 export { CosmosChartModule } from './cm-chart/chart.module'; export { CosmosPieModule } from './cm-pie/pie.module'; export { CosmosBarModule } from './cm-bar/bar.module'; export { CosmosRadarModule } from './cm-radar/radar.module'; export { CosmosFunnelModule } from './cm-funnel/funnel.module'; export { CosmosScatterModule } from './cm-scatter/scatter.module'; export { CosmosStitchesModule } from './cm-stitches/stitches.module'; // 导出组件 export { CosmosChartComponent } from './cm-chart/chart.component'; export { CosmosPieComponent } from './cm-pie/pie.component'; export { CosmosBarComponent } from './cm-bar/bar.component'; export { CosmosRadarComponent } from './cm-radar/radar.component'; export { CosmosFunnelComponent } from './cm-funnel/funnel.component'; export { CosmosScatterComponent } from './cm-scatter/scatter.component'; export { CosmosStitchesComponent } from './cm-stitches/stitches.component'; @NgModule({ imports: [ CosmosChartModule, CosmosPieModule, CosmosBarModule, CosmosRadarModule, CosmosFunnelModule, CosmosScatterModule, CosmosStitchesModule ] }) export class ChartComponentModule { static forRoot(): ModuleWithProviders { return { ngModule: ChartComponentModule, providers: [ CosmosChartService ] } } } export const chartComponentModuleArray: any[] = [ CosmosChartModule, CosmosPieModule, CosmosBarModule, CosmosRadarModule, CosmosFunnelModule, CosmosScatterModule, CosmosStitchesModule ];