0

I think popular question, but I don't found solution. Look e.g. I have object {title:..., book:.... author:...} and would like filter my view by title like below:

<div ng-repeat="product in main.products | filter: {{product.title}}">
  <span>{{product.author}}</span>
</div>

In <span> author has shown, but filter not working.

Mat.Now
  • 1,715
  • 3
  • 16
  • 31

2 Answers2

1

If you get your filter value from server side, you can easily simulate it as:

 $scope.by_title = '';


  $timeout(function(){
     $scope.by_title = 'on';
  },3000);

and:

 <tr ng-repeat="obj in objs | filter:{ title: by_title }">

DEMO PLUNKR

Maxim Shoustin
  • 77,483
  • 27
  • 203
  • 225
0

As you commented, you should use orderBy filter for this.

<div ng-repeat="product in main.products | orderBy: 'title'">
Hadi J
  • 16,989
  • 4
  • 36
  • 62