效果图:
作者:Easy
链接:https://zhuanlan.zhihu.com/p/22233323
css 样式
.selected{
background-color:#C6E2FF;
}
html 列表是遍历出来的
<li class="text-c" style="margin:10px;" ng-repeat="item in dataList |filter:name" ng-class='{selected:$index==selectedRow}' ng-click='selectedWhich($index)'>
<a style="text-decoration:none;font-size:10px;" ng-bind="item.groupName">
</a>
</li>
js 方法主要是判断列表的哪一项被选中
$scope.selectedWhich = function (row) {
$scope.selectedRow = row;
}
希望对你能有帮助!