我正在使用角度angular-filter
过滤和分组正在运行。但我还想检查过滤后的列表是否为空,类似于这个问题: AngularJS - placeholder for empty result from filter
在下面的示例中,我使用overflow: auto
通过player in filteredPlayers = (players | filter:search)
如何为示例中的分组列表执行类似操作?
代码:
filteredPlayers.length

var app = angular.module('myApp', ['angular.filter']);
app.controller('myCtrl', ['$scope', function($scope) {
$scope.players = [
{name: 'Gene', team: 'alpha'},
{name: 'George', team: 'beta'},
{name: 'Steve', team: 'gamma'},
{name: 'Paula', team: 'beta'},
{name: 'Scruath', team: 'gamma'}
];
}]);

答案 0 :(得分:0)
你可以做类似的事情:
.topmenu {
background: #6b00f3 linear-gradient(180deg, #7f0000, #6b0103) repeat scroll 0 0;
position: fixed;
top: 0;
left: 0;
height: 48px;
width: 100%;
box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}
.topmenu .container {
height: 100%;
}
.topmenu .container .links {
height: 100%;
}
.topmenu .container .links .link {
box-sizing: border-box;
height: 100%;
text-decoration: none;
padding: 0 10px;
color: #fff;
}
.topmenu .container .links .link:not(:last-child) {
border: 1px solid #630000;
}