greim / ng-falcor

Use Falcor in Angular 1.x Projects
MIT License
14 stars 6 forks source link

How to use your library with angularjs filter? #9

Open jean-morissette opened 8 years ago

jean-morissette commented 8 years ago

First, congratulations for your library!

Consider this example:

<div class="todo-list-item" ng-repeat="i in range | filter:searchText">

Since it performs a loop on indices, instead of JSON objects, how is-it possible to use the angular filter in this case?

Or would you recommend another approach to filter a list?

Thanks!

greim commented 8 years ago

That's a good question and I'm open to suggestions. Two ideas off the top of my head:

  1. ng-if="ngf('some_list', i, 'some_prop').indexOf(searchText)"
  2. Create a custom filter that accepts i and otherwise operates similar to the above.

What do you think?