我有一个角度页面,该页面通过数组返回以下数据
["BO01", "BO03", "BO04", "C.A.1.", "C.F.1.", "C.F.4.", "C.L.1.", "C.M.4.", "C.R.1.", "C.R.3.",…]
我想做的是在HTML列中显示这些Array值
<tr>
<th class="tg-0lax">BO01</th>
<th class="tg-0lax">BO03</th>
<th class="tg-0lax">BO04</th>
</tr>
答案 0 :(得分:2)
您可以使用ng-repeat遍历数组并显示列
js
$scope.columns = ["BO01", "BO03", "BO04", "C.A.1.", "C.F.1.", "C.F.4.", "C.L.1.", "C.M.4.", "C.R.1.", "C.R.3."];
html
<tr>
<th class="tg-0lax" ng-repeat="col in columns">{{col}}</th>
</tr>