angular - 以角度 4 在网格中显示 json 数组
问题描述
我在显示我从服务获取到 html 的 JSON 数组数据时遇到问题下面是我component.ts
从中获取 JSON 数据的文件代码
userdata(){
this.http.get(this.url).subscribe((res)=>{
this.arrBirds = res.json() as Application[];
console.log(this.arrBirds)
});
下面是我想要在网格中显示 JSON 数据的 HTML 代码
<table cellpadding="0" width="100%" cellspacing="0" border="0" class="search_grid_view table-striped">
<thead>
<tr>
<!-- <th style="min-width: 100px;">Login Name</th>
<th>First Name</th>
<th>Last Name</th>
<th>Role</th>
<th>Agreement Type</th>
<th>Status</th>
<th>User Type</th>
<th>Email</th> -->
<!-- <th>Action</th> -->
<th *ngFor="let col of getColumns">
{{col}}
</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let char of Griddata">
<td *ngFor="let col of getColumns">
{{char[col]}
</td>
<!-- <td>Demo</td>
<td>User</td>
<td>Admin</td>
<td>ISDA, MRA</td>
<td><a class="red_green_btn red_button" href="javascript:void(0);">In-Active</a></td>
<td>eClerx</td>
<td>demo.user@eclerx.com</td> -->
<!-- <td><a href="#"><img src="~/Content/images/edit.png" alt="" /> </a></td> -->
</tr>
</tbody>
</table>
但是网格没有填充 JSON 数据。上述问题的方法应该是什么?
解决方案
推荐阅读
- ruby - Leetcode 匹配对
- kubernetes - GKE 1.16.9 Prometheus,每个 pod 的 grafana 详细信息不起作用?
- html - 如何在 Rmarkdown HTML 中定位 CSS 中的 Div
- r - 如何使用 R 中的元包更改森林图中子组的顺序?
- amazon-web-services - 在 aws ubuntu 服务器的 chmod 777 /home 上使用 chmod,现在每个 ubuntu 服务器都无法登录
- javascript - 刷新网站时随机生成的数字不会改变。我正在使用 JavaScript 和 NodeJS
- android - 使用官方插件在 Flutter 中本地验证应用程序购买中的非消耗品
- c - 如何使用 C 编程语言计算在 .txt 文件中找到的数字的最小值?
- javascript - babel 插件语法在哪里定义?
- java - macOS 上的 Java 自动使用系统代理,如何禁用它?