【发布时间】:2016-06-28 20:56:39
【问题描述】:
我想做一个小型电子商务应用程序。用户完成订单后,管理员得到订单,订单项目由order id、itemname、price、status、btnclass组成。
订单默认状态为pending,btnclass的值为label-warning,编辑订单pending后,将btnclass的值更改为label-success。但我不知道该怎么做
btnclass 用于存储引导类。
<table>
<th>order id</th>
<th>item name</th>
<th>price</th>
<th>status</th>
<th>total</th>
<tr ng-repeat="item in orders">
<td>{{item.orderid}}</td>
<td>{{item.itemname}}</td>
<td>{{item.price}}</td>
<td><p class="label {{list.btnclass}}">{{item.status}}</p></td>
<td>{{item.total}}</td>
</tr>
</table>
我的数组是这样的:
[
{
"orderid":1,
"itemname":"rice",
"price":10,
"status":"pending",
"btnclass":"label-warning",
"total":10
},
{
"orderid":2,
"itemname":oils,
"price":50,
"status":"deliverd",
"btnclass":"label-success",
"total":50
}
请帮助我如何为表格数据提供类..
【问题讨论】:
标签: html angularjs angular-ui-bootstrap