Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/kubernetes/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular7 Mat Paginator问题_Angular7 - Fatal编程技术网

Angular7 Mat Paginator问题

Angular7 Mat Paginator问题,angular7,Angular7,我在我的项目中使用结构下方的mat表 **<mat-paginator></mat-paginator> <mat-table></mat-table> <mat-paginator></mat-paginator>** In my ts file look like **@ViewChild(MatPaginator) paginator: MatPaginator;** **Actual problem is

我在我的项目中使用结构下方的mat表

**<mat-paginator></mat-paginator>
<mat-table></mat-table>
<mat-paginator></mat-paginator>**

In my ts file look like

 **@ViewChild(MatPaginator) paginator: MatPaginator;**


 **Actual problem is first one paginator is working fine and trigger events correctly.
 bottom mat paginator is not working and event is not triggered ,also page,pageIndex is not 
refelecting from first paginator**
**
**
在我的ts文件中
**@ViewChild(MatPaginator)分页器:MatPaginator**
**实际问题是,第一个分页器工作正常,并正确触发事件。
底部mat分页器不工作且未触发事件,页、页索引也不工作
从第一个分页器重新选择**

@ViewChild
只查询一个组件引用。但您的视图中有两个组件。因此,您必须分别查询这两个组件,如下所示


@ViewChild('topPageinator')分页器:MatPaginator;
@ViewChild('bottomPaginator')分页器:MatPaginator

您可以使用
@ViewChildren
而不是
@ViewChildren


@ViewChildren(MatPaginator)分页器:QueryList

以上两种解决方案不起作用,事件也未触发。您能否共享视图(html文件)和逻辑(ts文件)的确切代码?