Title: Filtering and Periods in Object Keys · Issue #6005 · angular/angular.js · GitHub
Open Graph Title: Filtering and Periods in Object Keys · Issue #6005 · angular/angular.js
X Title: Filtering and Periods in Object Keys · Issue #6005 · angular/angular.js
Description: Hi folks, I'm putting together a front-end for interacting with an API. The results coming from the API are namespaced based on the database tables behind the API(also being developed). During development we were naming fields like so: "...
Open Graph Description: Hi folks, I'm putting together a front-end for interacting with an API. The results coming from the API are namespaced based on the database tables behind the API(also being developed). During deve...
X Description: Hi folks, I'm putting together a front-end for interacting with an API. The results coming from the API are namespaced based on the database tables behind the API(also being developed). During ...
Opengraph URL: https://github.com/angular/angular.js/issues/6005
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Filtering and Periods in Object Keys","articleBody":"Hi folks,\n\nI'm putting together a front-end for interacting with an API. The results coming from the API are namespaced based on the database tables behind the API(also being developed). During development we were naming fields like so: \"table.field\" to similarly match our database schema. We're doing this to avoid collisions in denormalized data. In using this naming scheme I stumbled upon what I think is a bug with ng-repeat and filtering if an object's keys have periods in them. \n\nHere's a basic, working ng-repeat:\n\n```\n\u003cinput type=\"text\" ng-model=\"abc.label\"\u003e\n\u003cul\u003e\n \u003cli ng-repeat=\"item in Array | filter: abc)\"\u003e{{item.label}}\u003c/li\u003e\n\u003c/ul\u003e\n```\n\nAnd here's a broken one. Let's say though that the object's key wasn't \"label\", but rather \"meta.label\":\n\n```\n\u003cinput type=\"text\" ng-model=\"abc['meta.label']\"\u003e\n\u003cul\u003e\n \u003cli ng-repeat=\"item in Array | filter: abc)\"\u003e{{item['meta.label']}}\u003c/li\u003e\n\u003c/ul\u003e\n```\n\nThese two examples have different behavior. It appears that the key that you're filtering on in the objects in the array cannot have a period in it. If it does have a period, the initial set will show, but as soon as the model value changes the set is truncated. Curiously even when the model's \"meta.label\" property is cleared, the set is still truncated.\n\nI put together an interactive example of two ng-repeats, one over an array with objects with periods in its keys, and one over an array of objects without periods in its keys. [You can see it here.](http://plnkr.co/edit/BU5YolgQtNJWmtr1wlPO?p=preview)\n\nFor the time being I'm going to have our API return data namespaced as \"table/field\", which seems to work as expected.\n","author":{"url":"https://github.com/gabrielmiller","@type":"Person","name":"gabrielmiller"},"datePublished":"2014-01-27T21:15:18.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/6005/angular.js/issues/6005"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:76a00eea-d680-e2cf-09ea-26740c8577d3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DE14:3D1150:311A8B:4097A9:6A5B2208 |
| html-safe-nonce | 97281be04d4856ca8e1f81d6c5509e1a0337bf7ec2659ef457349cf63533528e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERTE0OjNEMTE1MDozMTFBOEI6NDA5N0E5OjZBNUIyMjA4IiwidmlzaXRvcl9pZCI6IjM3OTcwMjI0MjYwMDcyODIxODQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4289f7c5d3056f7a99ecf8cd6024e8e87e9aa597d5787ca29e7f41f9a1a7ae1d |
| hovercard-subject-tag | issue:26395199 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular.js/6005/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7ed4ba4a488caa89ad1240a8241f320c561d51bb2543a95d069ea123a2ab704c/angular/angular.js/issues/6005 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7ed4ba4a488caa89ad1240a8241f320c561d51bb2543a95d069ea123a2ab704c/angular/angular.js/issues/6005 |
| og:image:alt | Hi folks, I'm putting together a front-end for interacting with an API. The results coming from the API are namespaced based on the database tables behind the API(also being developed). During deve... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gabrielmiller |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular.js git https://github.com/angular/angular.js.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 460078 |
| octolytics-dimension-repository_nwo | angular/angular.js |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 460078 |
| octolytics-dimension-repository_network_root_nwo | angular/angular.js |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width