You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
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: "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.
These 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.
I 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.
For the time being I'm going to have our API return data namespaced as "table/field", which seems to work as expected.
The text was updated successfully, but these errors were encountered:
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: "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.
Here's a basic, working ng-repeat:
And here's a broken one. Let's say though that the object's key wasn't "label", but rather "meta.label":
These 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.
I 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.
For the time being I'm going to have our API return data namespaced as "table/field", which seems to work as expected.
The text was updated successfully, but these errors were encountered: