0

私のAngular 5プロジェクトでTablesawを使用していますが、サービスからテーブルデータを取得しているときに機能しませんが、静的データを操作しています。

export class MmrParticipationListComponent implements OnInit {
pid; mid; participationList; approversList = [];

constructor(private activatedRoute: ActivatedRoute, private programService: 
ProgramService) { }

ngOnInit() {
this.activatedRoute.queryParams.subscribe(params => {
  this.pid = +params['pid'];
  this.mid = +params['mid'];

  this.programService.getParticipationList(this.pid, this.mid, 0).subscribe(a => {
    this.participationList = a;

    this.programService
      .getParticipationListPerEachGroup(this.pid, this.mid, this.participationList.FillRepeater[0].MMRPTID)
      .subscribe(b => {     this.approversList = b;}
      );
    });
   });
  }
}

<table *ngIf="approversList" class="tablesaw tablesaw-stack table table-
hover table-custom" data-tablesaw-mode="stack">
<thead>
<tr>      <th>Role</th>   <th>Name</th>    </tr>
</thead>
<tbody>
<tr *ngFor="let item of approversList">    
<td>{{item.Role}}</td>  <td>{{item.Name}}</td>  
</tr>
 </tbody>
</table>
4

2 に答える 2