Skip to content

Commit

Permalink
fix(live-chart): use Angular DI to inject DatePipe.
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimio committed Jan 18, 2019
1 parent 27ab67f commit 9a0b104
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ export function getRandomInt(min: number, max: number): number {
template: `
<h4>Live Updating</h4>
<x-chartist [data]="data" [type]="type"> </x-chartist>
`
`,
providers: [DatePipe]
})
export class LiveChartComponent implements OnDestroy {
public data: LiveData;
public type: ChartType;

private timerSubscription: Subscription;
private datePipe = new DatePipe('en');

constructor() {
constructor(private datePipe: DatePipe) {
this.data = {
labels: [],
series: [[]]
Expand Down

0 comments on commit 9a0b104

Please sign in to comment.