|
1 | 1 | import {Component, Input, ElementRef, OnInit, |
2 | 2 | OnChanges, DoCheck, AfterViewInit, OnDestroy, |
3 | | - KeyValueDiffers, ViewChild} from '@angular/core'; |
| 3 | + KeyValueDiffers, ViewChild, NgZone} from '@angular/core'; |
4 | 4 |
|
5 | 5 | import { FusionChartsService } from './fusioncharts.service'; |
6 | 6 | import { FusionChartsConstructor } from './fusioncharts.constructor'; |
@@ -141,7 +141,7 @@ export class FusionChartsComponent implements OnInit, OnChanges, DoCheck, AfterV |
141 | 141 | element: ElementRef; |
142 | 142 | fusionchartsService: FusionChartsService; |
143 | 143 |
|
144 | | - constructor(element: ElementRef, fusionchartsService: FusionChartsService, private differs: KeyValueDiffers) { |
| 144 | + constructor(element: ElementRef, fusionchartsService: FusionChartsService, private differs: KeyValueDiffers, private zone: NgZone) { |
145 | 145 | this.element = element; |
146 | 146 | this.fusionchartsService = fusionchartsService; |
147 | 147 | } |
@@ -237,10 +237,11 @@ export class FusionChartsComponent implements OnInit, OnChanges, DoCheck, AfterV |
237 | 237 | configObj['renderAt'] = 'container-' + _this.chartObj.id; |
238 | 238 | _this.containerId = _this.chartObj.id; |
239 | 239 |
|
240 | | - setTimeout(() => { |
241 | | - _this.chartObj.render(_this.configObj['renderAt']); |
242 | | - }, 1); |
243 | | - |
| 240 | + this.zone.runOutsideAngular(() => { |
| 241 | + setTimeout(() => { |
| 242 | + _this.chartObj.render(_this.configObj['renderAt']); |
| 243 | + }, 1); |
| 244 | + }) |
244 | 245 | } |
245 | 246 | } |
246 | 247 |
|
|
0 commit comments