Skip to content

Commit

Permalink
fixed #2235
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrtcndkn committed Mar 7, 2017
1 parent d35f4d1 commit 00067fe
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions components/chart/chart.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {NgModule,Component,ElementRef,AfterViewInit,OnDestroy,Input,Output,EventEmitter,IterableDiffers} from '@angular/core';
import {NgModule,Component,ElementRef,AfterViewInit,OnDestroy,Input,Output,EventEmitter} from '@angular/core';
import {CommonModule} from '@angular/common';

declare var Chart: any;
Expand All @@ -15,8 +15,6 @@ export class UIChart implements AfterViewInit, OnDestroy {

@Input() type: string;

@Input() data: any;

@Input() options: any;

@Input() width: string;
Expand All @@ -26,13 +24,20 @@ export class UIChart implements AfterViewInit, OnDestroy {
@Output() onDataSelect: EventEmitter<any> = new EventEmitter();

initialized: boolean;

_data: any;

chart: any;

differ: any;
constructor(public el: ElementRef) {}

@Input() get data(): any {
return this._data;
}

constructor(public el: ElementRef, differs: IterableDiffers) {
this.differ = differs.find([]).create(null);
set data(val:any) {
this._data = val;
this.reinit();
}

ngAfterViewInit() {
Expand Down

0 comments on commit 00067fe

Please sign in to comment.