Skip to content

Commit

Permalink
feat(charts): Expose chart object (#472)
Browse files Browse the repository at this point in the history
- Add exportAs directive decorator property
- Update chart and ctx properties to public
  • Loading branch information
anthony-pinskey authored and valorkin committed Oct 27, 2016
1 parent 527d9a3 commit e46b5d1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions components/charts/charts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
declare var Chart:any;

/* tslint:disable-next-line */
@Directive({selector: 'canvas[baseChart]'})
@Directive({selector: 'canvas[baseChart]', exportAs: 'base-chart'})
export class BaseChartDirective implements OnDestroy, OnChanges, OnInit {
public static defaultColors:Array<number[]> = [
[255, 99, 132],
Expand Down Expand Up @@ -42,9 +42,9 @@ export class BaseChartDirective implements OnDestroy, OnChanges, OnInit {
@Output() public chartClick:EventEmitter<any> = new EventEmitter();
@Output() public chartHover:EventEmitter<any> = new EventEmitter();

private ctx:any;
public ctx:any;
public chart:any;
private cvs:any;
private chart:any;
private initFlag:boolean = false;

private element:ElementRef;
Expand Down Expand Up @@ -150,7 +150,7 @@ export class BaseChartDirective implements OnDestroy, OnChanges, OnInit {
}

if (!datasets) {
throw new Error(`ng-charts configuration error,
throw new Error(`ng-charts configuration error,
data or datasets field are required to render char ${this.chartType}`);
}

Expand Down

0 comments on commit e46b5d1

Please sign in to comment.