poo*_*hah 1 dom angularjs angularjs-ng-repeat
var dataList = [{Id:1,Name: "xyz",Select: true},
{Id:2,Name: "PQR",Select : false }];
var headerList = [{"ID","Name","null"}]
Run Code Online (Sandbox Code Playgroud)
我从服务器端获得此值,我无法在此数组列表中进行任何更改.
我的HTML代码是
<table class= "table table-bordered">
<thead>
<tr ng-repeat="header in headerList">
<td ng-if="!$last">
{{header}}
</td>
</tr>
</thead>
<tbody>
<tr ng-repeat="data in dataList">
<td ng-repeat="value in data" ng-if="!$last">
{{value}}
</td>
</tr>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)
我不想生成"选择"列.代码工作正常,但当有条件的类适用于表时,显示一个空白列,即"选择"
那我怎么能删除html DOM中的这个空白列?
小智 7
你可能想写
<thead>
<tr>
<td ng-if="!$last" ng-repeat="header in headerList">
{{header}}
</td>
</tr>
</thead>
Run Code Online (Sandbox Code Playgroud)
而不是这个
<thead>
<tr ng-repeat="header in headerList">
<td ng-if="!$last">
{{header}}
</td>
</tr>
</thead>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9484 次 |
| 最近记录: |