AY
Size: a a a
AY
R

R

V
R
V
R
V
V
R
V
V
DK
В
OM
mat-table с которым я хочу испрользовать matSort. Датасорс таблицы сделал кастомный из примера: export class OrdersDataSource extends BaseDataSource {
constructor(private ordersService: OrderService) {
super();
}
loadOrders(queryParams: QueryParamsModel, orderNumber?: number, orderStatus?: OrderStatus, userId?: string) {
const delegate = this.ordersService.getOrderHistory.bind(this.ordersService);
delegate(queryParams, orderNumber, orderStatus, userId)
.pipe(
catchError(() => from([])))
.subscribe(res => {
this.entitySubject.next(res.items);
this.paginatorTotalSubject.next(res.totalCount);
});
}
}matSort, после иницализации вюшки, делаю так: ngAfterViewInit() {
this.sort.sortChange
.pipe(takeUntil(this.destroy))
.subscribe(() => this.paginator.pageIndex = 0);
merge(this.sort.sortChange, this.paginator.page)
.pipe(
tap(() => {
this.loadOrders();
}),
takeUntil(this.destroy)
)
.subscribe();
}
sort беру ViewChild-ом : @ViewChild(MatSort, { static: true }) sort: MatSort;Attempting to configure '__source' with descriptor '{"value":"MatSortHeader","configurable":true}' on object 'function MatSort() {
var _this = _super !== null && _super.apply(this, arguments) || this;
/**
* Collection of all registered sortables that this directive manages.
*/
_this.sortables = new Map();
/**
* Used to notify any child components listening to state changes.
*/
_this._stateChanges = new rxjs__WEBPACK_IMPORTED_MODULE_4__["Subject"]();
/**
* The direction to set when an MatSortable is initially sorted.
* May be overriden by the MatSortable's sort start.
*/
_this.start = 'asc';
_this._direction = '';
/**
* Event emitted when the user changes either the active sort or sort direction.
*/
_this.sortChange = new _angular_core__WEBPACK_IMPORTED_MODULE_2__["EventEmitter"]();
return _this;
}' and got error, giving up: TypeError: Cannot define property __source, object is not extensibleAB
В
В