license import { Inject , Injectable , InjectionToken } from '@angular/core' ; import * as Highcharts from 'highcharts' ; import * as Highstock from 'highcharts/highstock' ; import * as Highmaps from 'highcharts/highmaps' ; import * as HighchartsGnatt from 'highcharts/highcharts-gantt' ; export let HIGHCHARTS_MODULES = new InjectionToken < any [ ] > ( 'HighchartsModules' ) ; @ Injectable ( ) export class ChartService { constructor ( @ Inject ( HIGHCHARTS_MODULES ) private chartModules ) { } initModules ( ) { this . chartModules . forEach ( chartModule => { [ Highcharts , Highstock , Highmaps , HighchartsGnatt ] . forEach ( chartModule ) ; } ) ; } }