javascript - Migrate custom AngularJS filter from 1.2.28 to 1.4.x -
i have complex json response iterated on using ng-repeat. relatively small subset of attributes within result set displayed on screen, filtering of results should restricted values user can see, otherwise filtering behavior confusing end-user.
since 1 of attributes wish filter on nested array, custom filter needed since built-in angularjs filterfilter not iterate on array elements best of knowledge.
i able working time in angularjs v1.2.28, unfortunately appears break during migration v1.4.3. have not spent time isolate in release cadence functionality broke however.
i have not found helpful information in migration guides indicate has changed. know actual/expected parameters filter receive different values in latest major version of angularjs, leads failure.
ng-repeat filter expression:
<li ng-repeat="user in users | list_filter:{establishment: {id: filtertext, names: [{name: filtertext}], locations: [{streetaddress1: filtertext, streetaddress2: filtertext, city: filtertext, stateprovince: filtertext, postalcode: filtertext}]}}">
example data structure of single element:
data = [{ id: 234567, name: 'john doe', establishment: { id: 067915959, locations: [{ id: '134b030365f5204ee05400212856e994', type: 'postal', streetaddress1: 'p o box 900', city: 'grover', stateprovince: 'ca', postalcode: '902340900', isocountrycode: 'us', region: 'monroe' }, { id: '999b030365f4204ee05400212856e991', type: 'postal', streetaddress1: '2590 atlantic ave', city: 'fredricks', stateprovince: 'va', postalcode: '45487', isocountrycode: 'us', region: 'monroe' }], names: [{ name: 'grover central school dst', type: 'primary' }, { name: 'grover central school dst', type: 'marketing' }, { name: 'grover central school district', type: 'legal' }] } }];
supporting plunker examples:
- plunker version 1.2.28: http://plnkr.co/edit/kd1mmnmbeho7x2v9yk4s?p=info
- plunker version 1.4.3: http://plnkr.co/edit/ompoowrwchupututwocc?p=info
edit:
the issue appears directly related changes introduced in v1.3.6.
Comments
Post a Comment