import { NgModule , ModuleWithProviders } from '@angular/core' ; import { ChartComponent } from './ChartComponent' ; import { ChartSeriesComponent } from './ChartSeriesComponent' ; import { ChartPointComponent } from './ChartPointComponent' ; import { ChartXAxisComponent } from './ChartXAxisComponent' ; import { ChartYAxisComponent } from './ChartYAxisComponent' ; import { HighchartsStatic } from './HighchartsService' ; const CHART_DIRECTIVES = [ ChartComponent , ChartSeriesComponent , ChartPointComponent , ChartXAxisComponent , ChartYAxisComponent ] ; @ NgModule ( { declarations : [ CHART_DIRECTIVES ] , exports : [ CHART_DIRECTIVES ] } ) export class ChartModule { static forRoot ( highchartsStatic , ... highchartsModules ) { highchartsModules . forEach ( ( module ) => { module ( highchartsStatic ) ; } ) ; return { ngModule : ChartModule , providers : [ { provide : HighchartsStatic , useValue : highchartsStatic } ] } ; } } export { ChartComponent , ChartSeriesComponent , ChartPointComponent , ChartXAxisComponent , ChartYAxisComponent , } ;