问题
Just recently upgraded my app from ng 1.1.5 to 1.2.2 . The structure for the part with the issue is,
- a sort of form to add privileges. This form is also used for filtering the list below.
- an ng-repeat list to list the privileges defined.
It used to work as described, but changed its behaviour after 1.2.2, now the listing comes empty, after i change the select options then based on the selected items, filter kicks in and shows only the filtered rows.
So, just couldn't find a way to implement my original design with 1.2.2.
Here are the fiddles for both working and non-working versions, the code in both versions is identical, the only difference is version of the AngularJS library:
1.1.5 (working): http://jsfiddle.net/yasarbayar/5zkH4/
1.2.2 (not-working): http://jsfiddle.net/yasarbayar/h4vYL/
I have to put some code for jsfiddle links to get kicked in, so a portion of the code from jsfiddle is:
$scope.model = {
level_id: null,
type: null,
topic_id: null,
access: null,
create: null,
read: null,
update: null,
delete: null
};
$scope.access = {...};
Any help is appreciated. Thanks,
回答1:
Your problems are related to your filters. And let me tell you, those are some seriously hairy filters.
I don't know that this will actually fix the problem, but I'd suggest writing a custom filter for this application.
回答2:
I created a bug report on angularjs github, and seems like the filterFilter function is changed. So,
if you want to match anything then you now need to set the filter property to undefined.
来源:https://stackoverflow.com/questions/20189094/angularjs-after-upgrading-from-1-1-5-to-1-2-2-filter-issue