0

i'm trying to get 2 object of a table.

var tab=[
{t:"t1",selected:true},
{t:"t2"},
{t:"t3",selected:false}];

Where selected is false or undefined.

With $filter('filter')(tab,{selected:"!"}||{selected:false});

I only get the object [{"t":"t2"}]

Is it possible to filter with an or operator with this filter?

1
  • 1
    Why don't you just do it before the filter and then pass it in? Commented Mar 15, 2016 at 9:41

1 Answer 1

1

You need to create your own filter for it:

.filter('myfilter', function() {
  return function(selected) {
    return selected === '!' || selected === false;
  };
});
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.