fixed dataTime range bug & clean code

This commit is contained in:
Yubing325
2020-07-10 15:46:12 -05:00
parent a0445f2474
commit bf6280aa1c
8 changed files with 55 additions and 64 deletions
@@ -15,12 +15,14 @@ export class DataGridDemoHomeComponent implements OnInit, OnDestroy {
columns = ['id','name', 'address', 'commands']
merchantDataSource: IDataSource<IMerchant>;
private _dataSubscription: Subscription;
private _loading: Subscription;
constructor(private merchantService: MerchantService){
this.merchantDataSource = this.createDataSource();
}
ngOnDestroy(): void {
this._dataSubscription.unsubscribe();
this._loading.unsubscribe();
}
@@ -46,7 +48,7 @@ export class DataGridDemoHomeComponent implements OnInit, OnDestroy {
}
ngOnInit() {
this.merchantDataSource.loading$.subscribe(isLoading => {
this._loading = this.merchantDataSource.loading$.subscribe(isLoading => {
console.log('merchant data source event loading', isLoading);
});