想问一下如何使用角度滤波器功能对特定字段进行过滤?以下是我使用角度滤镜的方法:
<div class="memberTitle">Our Members</div>
<div class="form-horizontal">
<div class="form-group">
<div class="col-md-12 col-sm-12">
<input style="margin-left: auto; margin-right: auto; width: 40%;"
ng-model="searchMember" class="form-control" placeholder="Search members here...">
</div>
</div>
</div>
<br>
<ul ng-controller="FriendCtrl" ng-init="getMembers()">
<li class="browseMembers"
ng-repeat="member in members | filter:searchMember">
<table>
例如,如果我想使用用户名进行过滤,我应该怎么做?
答案 0 :(得分:1)
<li class="browseMembers"
ng-repeat="member in members | filter: { username: searchMember }">
<table>
如果您想过滤username
属性,这应该有用。