angular multiple filters with orderBy

110 views Asked by At

i have the following statement:

ng-repeat="module in academy.modules | filter: {is_complete: 0}  | limitTo: 5 | orderBy:'-is_open' | pastDate: 'futureAndNull'"

This repeat runs over an array that looks like this:

  academy_id: 36
  academy_module: Object
  academy_team_id: 130
  date: null
  deadline: null
  is_complete: 0
  is_open: 0
  module: Object
  module_id: 38
  prevName: "Konstruktionstest"
  score_to_pass: 40
  sort_number: 11
  user_id: 114

Some of the arrays has the value is_open set to 1

The elements with combination: is_open = 1 & is_complete = 0 is the ones i want to show as the first item(s)

if you look at the first filter i first filter the ones where is_complete = 0 and then in the orderBy i filter by is_open (DESC)

However this does not work.

The reason i am not filtering on is_open = 1 is because i want to show the other elements aswell and these would not be visible then.

So what can i do?

0

There are 0 answers