完整的 ng-table排序,搜索不是 workink angular 10

问题描述

我正在尝试使用 the full ng-table,但它不适用于 angular 10。

当我尝试复制粘贴代码时,此处出现错误

@Directive({
 selector: 'th[mzSortable]',host: {
 '[class.asc]': 'direction === "asc"','[class.desc]': 'direction === "desc"','(click)': 'rotate()'
 }
})

我尝试使用这个...

@Input() sortable: SortColumn = '';

@Input()
direction: SortDirection = '';

@Input()
@HostBinding('class.asc')
get ascClass (): any {
 return this.direction === 'asc';
}

@Input()
@HostBinding('class.desc')
get descClass (): any {
  return this.direction === 'desc';
}

@Output() sort = new EventEmitter<SortEvent>();

@HostListener('click')
rotate(): void {
  this.direction = rotate[this.direction];
  this.sort.emit({column: this.sortable,direction: this.direction});
}

现在表格出现了,但我无法对表格进行排序

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)