@@ -100,7 +100,7 @@ export class HighchartsChartDirective {
100100 stockChart : ( highCharts as any ) . stockChart ,
101101 } ;
102102
103- return new Promise < Highcharts . Chart | undefined > ( ( resolve ) => {
103+ return new Promise < Highcharts . Chart | undefined > ( resolve => {
104104 pendingChartsCount ++ ;
105105
106106 // If this is the first chart in the batch, start a new Promise chain
@@ -109,31 +109,33 @@ export class HighchartsChartDirective {
109109 chartInitializationQueue = Promise . resolve ( ) ;
110110 }
111111
112- chartInitializationQueue = chartInitializationQueue . then ( ( ) => {
113- if ( this . isDestroyed ) {
114- resolve ( undefined ) ;
115- return ;
116- }
117-
118- try {
119- const createdChart = chartFactories [ constructorType ] (
120- this . el . nativeElement ,
121- untracked ( ( ) => this . options ( ) ) ,
122- callback ,
123- ) ;
124- resolve ( createdChart as Highcharts . Chart ) ;
125- } catch ( error ) {
126- console . error ( 'Highcharts-Angular: Error initializing chart' , error ) ;
127- resolve ( undefined ) ;
128- }
129- } ) . finally ( ( ) => {
130- pendingChartsCount -- ;
131- // Once all queued charts have rendered, wipe the queue cleanly.
132- // This prevents tests from leaking state into each other.
133- if ( pendingChartsCount === 0 ) {
134- chartInitializationQueue = null ;
135- }
136- } ) ;
112+ chartInitializationQueue = chartInitializationQueue
113+ . then ( ( ) => {
114+ if ( this . isDestroyed ) {
115+ resolve ( undefined ) ;
116+ return ;
117+ }
118+
119+ try {
120+ const createdChart = chartFactories [ constructorType ] (
121+ this . el . nativeElement ,
122+ untracked ( ( ) => this . options ( ) ) ,
123+ callback ,
124+ ) ;
125+ resolve ( createdChart as Highcharts . Chart ) ;
126+ } catch ( error ) {
127+ console . error ( 'Highcharts-Angular: Error initializing chart' , error ) ;
128+ resolve ( undefined ) ;
129+ }
130+ } )
131+ . finally ( ( ) => {
132+ pendingChartsCount -- ;
133+ // Once all queued charts have rendered, wipe the queue cleanly.
134+ // This prevents tests from leaking state into each other.
135+ if ( pendingChartsCount === 0 ) {
136+ chartInitializationQueue = null ;
137+ }
138+ } ) ;
137139 } ) ;
138140 } ) ;
139141
0 commit comments