【发布时间】:2016-09-20 14:19:16
【问题描述】:
我希望控制器中的值显示在同一列的两行中。
{{ngapp}}.controller("Controller", function($scope, $http, $modalInstance){
$scope.selected=[];
$scope.items=[
{
value:'Impact to Safety, regulatory compliance environment',
key:10,
color:'red'
},
{
value:'Reliability Impact',
key:9,
color:'brown'
}
]
});
html 中的代码:
<div class="well form-group" >
<table class="table" cellspacing="1">
<tr>
<th>Rank</th>
<th>Criteria: Type of loss incurred</th>
</tr>
<tr ng-repeat="item in items" onclick="selected.item= item" ng-click="sel(item)">
<td ng-style="{ 'background-color': item.color }">{{item.key}}</td>
<td> {{item.value}} </td>
</tr>
</table>
//<label>{{selected.item}}</label>
{% endverbatim %}
</div>
我希望将值:“对安全的影响”显示在一行中。并且“监管合规环境”在同一列和同一键的新行中。有人可以帮忙吗?谢谢。我是新来的。
其他部分的代码,参考这个问题,
【问题讨论】:
-
你能添加你的html吗?
-
问题中添加了Html。