这是我的控制器:
varDemoApp.controller('SimpleController',function($scope){
$scope.customers = [{name:'Ahsan',city:'Khulna'},
{name:'Rokib',city:'Bogra'},
{name:'Asad',city:'Satkhira'}];
});
我的html代码是:
<div data-ng-controller="SimpleController">
Name:
<br/>
<input type="text" data-ng-model="name"/>
<ul>
<li data-ng-repeat="cust in customers|filter:name|orderBy:'name'">
{{cust.city}}-{{cust.name}}
</li>
</ul>
</div>
我只想按“customers.name”过滤,但现在它按整体客户数组过滤。