Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/28.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
Angular 在值更改后,预处理表保存所选页面_Angular_Primeng - Fatal编程技术网

Angular 在值更改后,预处理表保存所选页面

Angular 在值更改后,预处理表保存所选页面,angular,primeng,Angular,Primeng,我有一张简单的素描表 <p-table [value]="users" [paginator]="true" [rows]="5"> <ng-template pTemplate="header"> <tr> <th>name</th> </tr> </ng-template> <ng-template pTemplate="

我有一张简单的素描表

<p-table [value]="users"
          [paginator]="true" 
          [rows]="5">
  <ng-template pTemplate="header">
    <tr>
      <th>name</th>
    </tr>
  </ng-template>
  <ng-template pTemplate="body" let-user>
    <tr>
      <td>{{user}}</td>
    </tr>
  </ng-template>
</p-table>
选择表中的第二页,然后将新值分配给此。用户

this.users = ['Gregor', 'Ronald'];
但表中仍然选择了第二个页面,所以表中并没有用户。现场观看

我只需删除第二页并单击“更改名称”。新名称不可见

有没有办法从代码中修复它?

根据,你运气不好。不幸的是,当涉及到这些框架时,限制是生活的一部分

然而,你总是可以用锤子和炸药的方法来破解它


必须使用此修复程序,谢谢
this.users = ['Gregor', 'Ronald'];