我有一个问题,我的动态数据没有绑定到UI以及数据表。我尝试使用各种方式,但无法正常工作。我正在使用智能管理最新主题来开发网站
当我按下api时,我会做出回应。
var tabledata:any[]=[]
Get(){
this.getservice().subscribe(
res=>{
if(res && res.data && res.data.length>0){
this.tabledata=res.data;
console.log(this.tabledata);
}
}
)
}
在html
<tr *ngFor="let data of tabledata">
<td>{{data.name}}</td>
<td>{{data.age}}</td>
</tr>