This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Filters breaking change #10491
Closed
Description
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.