这是我的表NG-会显示多个值
<table class="table table-bordered table-responsive table-hover add-lineheight table_scroll">
<thead>
<tr>
<th ng-hide="hidecolumn == key" ng-repeat="(key, value) in localNew[0]">
{{key}}
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="test in localNew">
<td ng-hide="hidecolumn == key" ng-repeat="(key, value) in test">
{{value}}
</td>
</tr>
</tbody>
</table>
这里hidecolumn将隐藏我的专栏,我不想显示 比如,对于我的控制器
这是我的数据
$scope.localNew = [{ 'name': 'name1', 'age': 24, "salary": 2500, "s": 5 }, { 'name': 'name2', 'age': 26, "salary": 2600, "s": 5 }];
而这个我的隐藏列变量
$scope.hidecolumn = "salary";
这工作得很好
现在我的问题是,我想隐藏多列 所以我的范围变量会像
$scope.hidecolumn = "name,salary";
所以,我怎么能在我的HTML表格中隐藏多个管理这个列即多个隐藏值???如果你仍然不得到我的问题让我知道我会加plunker.Thanku
我的隐藏列是一个字符串,它将是逗号分隔的字符串,因为我写了一个指令,这将作为属性传递给该指令,它将根据该指令隐藏 –
这样做感觉很奇怪,米想知道用例,但确定:) – Maxime
我可以通过一个数组属性指令 –