Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
toggleRow: (any) => Observable;
@Input()
addRow: () => Observable;
@Input()
dateFilter: any = null;
shops: RetailShop[] = [];
shop: RetailShop;
shopsSub: Subscription;
shopSub: Subscription;
currentPage: number = 1;
pageSize: number = 50;
sortBy: string = 'id';
fromDate: Date;
toDate: Date;
sortOrder: TdDataTableSortingOrder = TdDataTableSortingOrder.Descending;
constructor(private _loadingService: TdLoadingService,
private _shopService: RetailShopsService) {
this._loadingService.create({
name: 'tables',
type: LoadingType.Circular,
mode: LoadingMode.Indeterminate,
color: 'warn',
});
}
ngOnInit() {
this.shop = this._shopService.shop;
this.shops = this._shopService.shops;
this.getData();
this.shopsSub = this._shopService.shops$.subscribe((data: RetailShop[]) => {
sort(name: string, sortOrder: TdDataTableSortingOrder): void {
this.sortBy = name;
if (sortOrder.toString() == 'ASC') {
this.sortOrder = TdDataTableSortingOrder.Descending
}
else {
this.sortOrder = TdDataTableSortingOrder.Ascending
}
this.filter();
}
sort(name: string, sortOrder: TdDataTableSortingOrder): void {
this.sortBy = name;
if (sortOrder.toString() == 'ASC') {
this.sortOrder = TdDataTableSortingOrder.Descending
}
else {
this.sortOrder = TdDataTableSortingOrder.Ascending
}
this.getData();
}
sort(name: string, sortOrder: TdDataTableSortingOrder): void {
this.sortBy = name;
if (sortOrder.toString() == 'ASC') {
this.sortOrder = TdDataTableSortingOrder.Descending
}
else {
this.sortOrder = TdDataTableSortingOrder.Ascending
}
this.getData();
}
search(searchTerm: string): void {