0

I have an ng-repeat like this:

<li data-ng-repeat="something in things | filter: {filter1: true, filter2: 'somestring'}">{{ something.title }}</li>

In Angular 1.1.5 I used to be able to set filter1 and filter2 to null and no filters would be applied, but since I updated to 1.2.7 this no longer works, how can I programmatically disable the filter?

3
  • Are you using custom filters or angular filters? Which ones? Commented Jan 10, 2014 at 18:39
  • filter1 and filter2 are properties on the "something", for example when filter1 = true it should display only the items that are something.filter1 = true Commented Jan 10, 2014 at 18:44
  • So wouldn't it make sense that if you say filter1: null that it should display only the items that are something.filter1 = null? There's probably another way to accomplish what you're after. Commented Jan 10, 2014 at 18:54

1 Answer 1

2

There was change made in 1.2 (see issue 2797) which results in the difference you're seeing. The change was to fix a problem where falsy filter values were not applied correctly. If you initialise the values of filter1 and filter2 to undefined instead of null then you will the see the same behaviour as you did in 1.1.5.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.