0
여기 내 컨트롤러 :angularJS의 배열에서 특정 항목을 필터링하는 방법은 무엇입니까?
varDemoApp.controller('SimpleController',function($scope){
$scope.customers = [{name:'Ahsan',city:'Khulna'},
{name:'Rokib',city:'Bogra'},
{name:'Asad',city:'Satkhira'}];
});
그리고 내 HTML 코드는 다음과 같습니다 나는 단지 'customers.name'에 의해 필터링하려는
<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>
하지만 지금은 전체 고객의 배열에 의해 필터링 할 수 있습니다.
덕분에 많은 : 하나 개 이상의 필터가 어떻게 표현이 갈 것이다 다음 필요한 경우 –
@artem를? 필터가 될 것입니다 : [{name : name}, {city : city}]'? 나는 여기에 인터넷에 도달 각도에 그냥 초보자입니다 –