Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Filters breaking change #10491

Closed
Serhioromano opened this issue Dec 17, 2014 · 1 comment
Closed

Filters breaking change #10491

Serhioromano opened this issue Dec 17, 2014 · 1 comment

Comments

@Serhioromano
Copy link

In new version something happened and now filters does not work as expected. Example

<input type="text" ng-model="q">
<ul>
  <li ng-repeat="item in items | filter: {name: q}">{{item.name}}</li>
</ul>

And

var app = angular.module('plunker', []);

app.controller('MainCtrl', function($scope) {
  $scope.items = [
    {
            "id": "1",
            "postcode": "4700",
            "name": "Rockhampton",
            "description": "One of the major cities in Central Queensland."
        },
        {
            "id": "16",
            "postcode": "4214",
            "name": "Keppel Island",
            "description": "Awesome islands, very few people, heaps of fish beautiful clear water."
        }
    ];
});

What happen that id q is not defined it does not show anything. Here is the plunkr

PLease check when you just open it first time list is empty. Only when you start search something and then delete search text, then it shows the list. Is you change angulars.js link to version 1.3.5 then it works.

The problem is this one. In real world I have filter which is select.

<select ng-model="filter.reg" ng-options="cnt.Region for cnt in form.result">
   <option value="">Any Region</option>
</select>

it means that in the filter I use | filter: {Region: filter.reg.Region}. But when I chose Any region is is always undefined. So I never see the list of items unless I select filter.

@caitp
Copy link
Contributor

caitp commented Dec 17, 2014

This looks like a duplicate of #10419 --- we hope to have all of the filter regressions merged shortly. This was not an intentional breaking change, but a regression resulting from poor test coverage.

@caitp caitp closed this as completed Dec 17, 2014
@Serhioromano Serhioromano changed the title Filters breacking change Filters breaking change Dec 18, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants