Skip to content

Commit

Permalink
trying to figure out change detection
Browse files Browse the repository at this point in the history
  • Loading branch information
weirdyang committed May 26, 2021
1 parent 35fcfdf commit 7884da8
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,23 @@ export class OrderBarChartComponent implements OnInit, AfterViewInit, OnDestroy
}]
subscription!: Subscription

constructor(private orderService: OrderService) { }
constructor(private orderService: OrderService) {
this.getDataSource();
this.subscription = interval(1000).subscribe({
next: () => this.getDataSource()
});
}
ngOnDestroy(): void {
this.subscription?.unsubscribe();
}
ngAfterViewInit(): void {
this.subscription = interval(1000).subscribe({
next: () => this.getDataSource()
});

}

private orders: Order[] = [];

ngOnInit() {
this.getDataSource();

}

getColors(): any[] {
Expand Down

0 comments on commit 7884da8

Please sign in to comment.