0

I am trying to modify a directive that was custom built and I do not want to modify if possible the way it is currently structured. I want to do exactly as stated in this question:

Using Filters With Directives in AngularJS

instead of a single value I am having trouble with passing an orderBy.

 orderBy: 'text': true

I am getting an error telling me the : is not expected. How can I pass this value via attribute from the element?

I also tried: <a href="#" filter="'orderBy: \'test\': true'">item</a>

Community
  • 1
  • 1
xivo
  • 2,054
  • 3
  • 22
  • 37
  • What you're trying to do doesn't entirely make sense. `orderBy` is not designed to filter items from a collection (i.e. it sorts). The directive you've linked to expects the `filter` attribute to be a predicate function that returns true if an item is to be filtered through. If you can elaborate with more code, that might help with an answer. – miqh Oct 03 '14 at 02:01
  • I'm trying to build a filter that's dynamic via an attribute. I'm not sure how to explain it. I'll write up some code sample and add to this question. Thanks! – xivo Oct 03 '14 at 15:47

0 Answers0